diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-10-22 14:10:54 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-10-22 14:10:54 -0300 |
| commit | b8cdea01908f8d436e9d5a73d640645ea52d5f65 (patch) | |
| tree | 970874505f774c28675b8af51a13e2786526bc9a | |
| parent | e592f94a643de0bf8d62f6c6128fe752c673f5ac (diff) | |
| download | lua-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.
| -rw-r--r-- | lobject.h | 2 |
1 files changed, 1 insertions, 1 deletions
| @@ -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); } |
