summaryrefslogtreecommitdiff
path: root/lstring.c
diff options
context:
space:
mode:
Diffstat (limited to 'lstring.c')
-rw-r--r--lstring.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lstring.c b/lstring.c
index 344276b8..05e5bbaa 100644
--- a/lstring.c
+++ b/lstring.c
@@ -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}