diff options
Diffstat (limited to 'ltable.c')
-rw-r--r-- | ltable.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltable.c,v 1.59 2000/11/24 17:39:56 roberto Exp roberto $ | 2 | ** $Id: ltable.c,v 1.60 2000/12/04 18:33:40 roberto Exp roberto $ |
3 | ** Lua tables (hash) | 3 | ** Lua tables (hash) |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -167,10 +167,8 @@ static void setnodevector (lua_State *L, Hash *t, luint32 size) { | |||
167 | ttype(&t->node[i].key) = ttype(&t->node[i].val) = LUA_TNIL; | 167 | ttype(&t->node[i].key) = ttype(&t->node[i].val) = LUA_TNIL; |
168 | t->node[i].next = NULL; | 168 | t->node[i].next = NULL; |
169 | } | 169 | } |
170 | if ((int)size > t->size) /* avoid "unsigned negative" values */ | 170 | L->nblocks -= gcsize(L, t->size); /* old size */ |
171 | L->nblocks += gcsize(L, size) - gcsize(L, t->size); | 171 | L->nblocks += gcsize(L, size); /* new size */ |
172 | else | ||
173 | L->nblocks -= gcsize(L, t->size) - gcsize(L, size); | ||
174 | t->size = size; | 172 | t->size = size; |
175 | t->firstfree = &t->node[size-1]; /* first free position to be used */ | 173 | t->firstfree = &t->node[size-1]; /* first free position to be used */ |
176 | } | 174 | } |