diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2007-11-09 16:55:07 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2007-11-09 16:55:07 -0200 |
| commit | 62790ab15d7fdb4ffa2b018196194d2132da3799 (patch) | |
| tree | d862219659c15e6a6be6ad4681102f3e956e7085 /lstring.c | |
| parent | ad60b3ead799fe77f5bcb378a58410835b79d596 (diff) | |
| download | lua-62790ab15d7fdb4ffa2b018196194d2132da3799.tar.gz lua-62790ab15d7fdb4ffa2b018196194d2132da3799.tar.bz2 lua-62790ab15d7fdb4ffa2b018196194d2132da3799.zip | |
detail
Diffstat (limited to 'lstring.c')
| -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; |
