From b803c0600eb20f3d4e47fd7a9ceecb096abcd3c6 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 11 May 2000 15:57:19 -0300 Subject: details --- ltable.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'ltable.c') diff --git a/ltable.c b/ltable.c index fb8b3dfe..3af51b62 100644 --- a/ltable.c +++ b/ltable.c @@ -1,5 +1,5 @@ /* -** $Id: ltable.c,v 1.40 2000/04/25 16:55:09 roberto Exp roberto $ +** $Id: ltable.c,v 1.41 2000/05/08 19:32:53 roberto Exp roberto $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -122,20 +122,13 @@ int luaH_pos (lua_State *L, const Hash *t, const TObject *key) { } - -static Node *hashnodecreate (lua_State *L, int nhash) { - Node *v = luaM_newvector(L, nhash, Node); +static void setnodevector (lua_State *L, Hash *t, int size) { int i; - for (i=0; inode = luaM_newvector(L, size, Node); + for (i=0; inode[i].key) = ttype(&t->node[i].val) = TAG_NIL; + t->node[i].next = NULL; } - return v; -} - - -static void setnodevector (lua_State *L, Hash *t, int size) { - t->node = hashnodecreate(L, size); t->size = size; t->firstfree = &t->node[size-1]; /* first free position to be used */ L->nblocks += gcsize(L, size); -- cgit v1.2.3-55-g6feb