MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / luaH_getstr

Function luaH_getstr

ThirdParty/lua/lua/ltable.c:520–534  ·  view source on GitHub ↗

** search function for short strings */

Source from the content-addressed store, hash-verified

518** search function for short strings
519*/
520const TValue *luaH_getstr (Table *t, TString *key) {
521 Node *n = hashstr(t, key);
522 lua_assert(key->tt == LUA_TSHRSTR);
523 for (;;) { /* check whether 'key' is somewhere in the chain */
524 const TValue *k = gkey(n);
525 if (ttisshrstring(k) && eqshrstr(tsvalue(k), key))
526 return gval(n); /* that's it */
527 else {
528 int nx = gnext(n);
529 if (nx == 0) break;
530 n += nx;
531 }
532 };
533 return luaO_nilobject;
534}
535
536
537/*

Callers 3

luaT_gettmFunction · 0.85
luaT_gettmbyobjFunction · 0.85
luaH_getFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected