From b8cdea01908f8d436e9d5a73d640645ea52d5f65 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 22 Oct 2019 14:10:54 -0300 Subject: 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. --- lobject.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lobject.h') diff --git a/lobject.h b/lobject.h index 0c38affe..7d30b46f 100644 --- 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); } -- cgit v1.2.3-55-g6feb