aboutsummaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-07-12 17:00:26 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-07-12 17:00:26 -0300
commit6dfdb765388da481a7020e44e7cfb253f9751699 (patch)
tree95af256d806f52658b6a268a0f6509f4383aa252 /hash.c
parent9a3c51cff1b925e125197e89a4c867c1d99ad1ba (diff)
downloadlua-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 'hash.c')
-rw-r--r--hash.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/hash.c b/hash.c
index 58598c7c..07b427bc 100644
--- a/hash.c
+++ b/hash.c
@@ -3,7 +3,7 @@
3** hash manager for lua 3** hash manager for lua
4*/ 4*/
5 5
6char *rcs_hash="$Id: hash.c,v 2.29 1996/02/14 18:25:04 roberto Exp roberto $"; 6char *rcs_hash="$Id: hash.c,v 2.30 1996/05/06 14:30:27 roberto Exp roberto $";
7 7
8 8
9#include "mem.h" 9#include "mem.h"
@@ -283,17 +283,11 @@ Object *lua_hashdefine (Hash *t, Object *ref)
283static void hashnext (Hash *t, int i) 283static void hashnext (Hash *t, int i)
284{ 284{
285 if (i >= nhash(t)) 285 if (i >= nhash(t))
286 {
287 lua_pushnil(); lua_pushnil();
288 return; 286 return;
289 }
290 while (tag(ref(node(t,i))) == LUA_T_NIL || tag(val(node(t,i))) == LUA_T_NIL) 287 while (tag(ref(node(t,i))) == LUA_T_NIL || tag(val(node(t,i))) == LUA_T_NIL)
291 { 288 {
292 if (++i >= nhash(t)) 289 if (++i >= nhash(t))
293 {
294 lua_pushnil(); lua_pushnil();
295 return; 290 return;
296 }
297 } 291 }
298 luaI_pushobject(ref(node(t,i))); 292 luaI_pushobject(ref(node(t,i)));
299 luaI_pushobject(val(node(t,i))); 293 luaI_pushobject(val(node(t,i)));