diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-12-22 14:57:46 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-12-22 14:57:46 -0200 |
commit | 0066bbbb0b882dab02909563c112a75626477a02 (patch) | |
tree | bbf8ca2c93eec7cfa26338aae958c5f7eba63d8f /lstring.c | |
parent | 1db05793a0793ae0b64cf809d4d1c4f98dba064a (diff) | |
download | lua-0066bbbb0b882dab02909563c112a75626477a02.tar.gz lua-0066bbbb0b882dab02909563c112a75626477a02.tar.bz2 lua-0066bbbb0b882dab02909563c112a75626477a02.zip |
details
Diffstat (limited to 'lstring.c')
-rw-r--r-- | lstring.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstring.c,v 1.45 2000/10/30 17:49:19 roberto Exp roberto $ | 2 | ** $Id: lstring.c,v 1.46 2000/11/24 17:39:56 roberto Exp roberto $ |
3 | ** String table (keeps all strings handled by Lua) | 3 | ** String table (keeps all strings handled by Lua) |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -72,10 +72,8 @@ void luaS_resize (lua_State *L, stringtable *tb, int newsize) { | |||
72 | } | 72 | } |
73 | } | 73 | } |
74 | luaM_free(L, tb->hash); | 74 | luaM_free(L, tb->hash); |
75 | if (newsize > tb->size) /* avoid "unsigned negative" values */ | 75 | L->nblocks -= tb->size*sizeof(TString *); |
76 | L->nblocks += (newsize - tb->size)*sizeof(TString *); | 76 | L->nblocks += newsize*sizeof(TString *); |
77 | else | ||
78 | L->nblocks -= (tb->size - newsize)*sizeof(TString *); | ||
79 | tb->size = newsize; | 77 | tb->size = newsize; |
80 | tb->hash = newhash; | 78 | tb->hash = newhash; |
81 | } | 79 | } |