diff options
-rw-r--r-- | lstring.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstring.c,v 2.8 2005/12/22 16:19:56 roberto Exp roberto $ | 2 | ** $Id: lstring.c,v 2.9 2006/07/11 15:53:29 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 | */ |
@@ -82,7 +82,8 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { | |||
82 | o != NULL; | 82 | o != NULL; |
83 | o = o->gch.next) { | 83 | o = o->gch.next) { |
84 | TString *ts = rawgco2ts(o); | 84 | TString *ts = rawgco2ts(o); |
85 | if (ts->tsv.len == l && (memcmp(str, getstr(ts), l) == 0)) { | 85 | if (h == ts->tsv.hash && ts->tsv.len == l && |
86 | (memcmp(str, getstr(ts), l) == 0)) { | ||
86 | /* string may be dead */ | 87 | /* string may be dead */ |
87 | if (isdead(G(L), o)) changewhite(o); | 88 | if (isdead(G(L), o)) changewhite(o); |
88 | return ts; | 89 | return ts; |