aboutsummaryrefslogtreecommitdiff
path: root/lobject.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-10-22 14:10:54 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-10-22 14:10:54 -0300
commitb8cdea01908f8d436e9d5a73d640645ea52d5f65 (patch)
tree970874505f774c28675b8af51a13e2786526bc9a /lobject.h
parente592f94a643de0bf8d62f6c6128fe752c673f5ac (diff)
downloadlua-b8cdea01908f8d436e9d5a73d640645ea52d5f65.tar.gz
lua-b8cdea01908f8d436e9d5a73d640645ea52d5f65.tar.bz2
lua-b8cdea01908f8d436e9d5a73d640645ea52d5f65.zip
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 (limited to 'lobject.h')
-rw-r--r--lobject.h2
1 files changed, 1 insertions, 1 deletions
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;
216 216
217#define bvalueraw(v) ((v).b) 217#define bvalueraw(v) ((v).b)
218 218
219#define l_isfalse(o) (ttisnil(o) || (ttisboolean(o) && bvalue(o) == 0)) 219#define l_isfalse(o) (ttisboolean(o) ? bvalue(o) == 0 : ttisnil(o))
220 220
221#define setbvalue(obj,x) \ 221#define setbvalue(obj,x) \
222 { TValue *io=(obj); val_(io).b=(x); settt_(io, LUA_TBOOLEAN); } 222 { TValue *io=(obj); val_(io).b=(x); settt_(io, LUA_TBOOLEAN); }