mirror of
https://github.com/lua/lua
synced 2025-04-12 16:02:52 +03:00
Small change in macro 'isvalid'
The "faster way" to check whether a value is not 'nilvalue' is not faster. (Both forms entail one memory access.)
This commit is contained in:
parent
664bda02ba
commit
724012d3d0
4
lapi.c
4
lapi.c
@ -40,10 +40,8 @@ const char lua_ident[] =
|
||||
|
||||
/*
|
||||
** Test for a valid index (one that is not the 'nilvalue').
|
||||
** '!ttisnil(o)' implies 'o != &G(L)->nilvalue', so it is not needed.
|
||||
** However, it covers the most common cases in a faster way.
|
||||
*/
|
||||
#define isvalid(L, o) (!ttisnil(o) || o != &G(L)->nilvalue)
|
||||
#define isvalid(L, o) ((o) != &G(L)->nilvalue)
|
||||
|
||||
|
||||
/* test for pseudo index */
|
||||
|
Loading…
x
Reference in New Issue
Block a user