commit b8cdea01908f8d436e9d5a73d640645ea52d5f65
parent e592f94a643de0bf8d62f6c6128fe752c673f5ac
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Tue, 22 Oct 2019 14:10:27 -0300
Changed definition of macro 'l_isfalse'
The old definition did one test for nil, but three tests for the all
too common booleans (and two tests for other values); this definition
does two tests for all values.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lobject.h b/lobject.h
@@ -216,7 +216,7 @@ typedef StackValue *StkId;
#define bvalueraw(v) ((v).b)
-#define l_isfalse(o) (ttisnil(o) || (ttisboolean(o) && bvalue(o) == 0))
+#define l_isfalse(o) (ttisboolean(o) ? bvalue(o) == 0 : ttisnil(o))
#define setbvalue(obj,x) \
{ TValue *io=(obj); val_(io).b=(x); settt_(io, LUA_TBOOLEAN); }