| 89 | |
| 90 | |
| 91 | TString *luaS_newhstr (lua_State *L, lua_Hash h, const char *str, size_t l) { |
| 92 | GCObject *o; |
| 93 | for (o = G(L)->strt.hash[lmod(h, G(L)->strt.size)]; |
| 94 | o != NULL; |
| 95 | o = o->gch.next) { |
| 96 | TString *ts = rawgco2ts(o); |
| 97 | if (ts->tsv.len == l && (memcmp(str, getstr(ts), l) == 0)) { |
| 98 | /* string may be dead */ |
| 99 | if (isdead(G(L), o)) changewhite(o); |
| 100 | return ts; |
| 101 | } |
| 102 | } |
| 103 | return newlstr(L, str, l, h); /* not found */ |
| 104 | } |
| 105 | |
| 106 | |
| 107 | TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { |
no test coverage detected