diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-07-12 17:00:26 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-07-12 17:00:26 -0300 |
commit | 6dfdb765388da481a7020e44e7cfb253f9751699 (patch) | |
tree | 95af256d806f52658b6a268a0f6509f4383aa252 /table.c | |
parent | 9a3c51cff1b925e125197e89a4c867c1d99ad1ba (diff) | |
download | lua-6dfdb765388da481a7020e44e7cfb253f9751699.tar.gz lua-6dfdb765388da481a7020e44e7cfb253f9751699.tar.bz2 lua-6dfdb765388da481a7020e44e7cfb253f9751699.zip |
C functions don't need to "pushnil" to return nil value (this is
the default value).
Diffstat (limited to 'table.c')
-rw-r--r-- | table.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -3,7 +3,7 @@ | |||
3 | ** Module to control static tables | 3 | ** Module to control static tables |
4 | */ | 4 | */ |
5 | 5 | ||
6 | char *rcs_table="$Id: table.c,v 2.55 1996/05/28 21:07:32 roberto Exp roberto $"; | 6 | char *rcs_table="$Id: table.c,v 2.56 1996/06/18 21:12:23 roberto Exp roberto $"; |
7 | 7 | ||
8 | #include "mem.h" | 8 | #include "mem.h" |
9 | #include "opcode.h" | 9 | #include "opcode.h" |
@@ -240,12 +240,7 @@ static void lua_nextvar (void) | |||
240 | else | 240 | else |
241 | next = luaI_findsymbolbyname(lua_getstring(o)) + 1; | 241 | next = luaI_findsymbolbyname(lua_getstring(o)) + 1; |
242 | while (next < lua_ntable && s_tag(next) == LUA_T_NIL) next++; | 242 | while (next < lua_ntable && s_tag(next) == LUA_T_NIL) next++; |
243 | if (next >= lua_ntable) | 243 | if (next < lua_ntable) |
244 | { | ||
245 | lua_pushnil(); | ||
246 | lua_pushnil(); | ||
247 | } | ||
248 | else | ||
249 | { | 244 | { |
250 | lua_pushstring(lua_table[next].varname->str); | 245 | lua_pushstring(lua_table[next].varname->str); |
251 | luaI_pushobject(&s_object(next)); | 246 | luaI_pushobject(&s_object(next)); |