MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / luaH_getshortstr

Function luaH_getshortstr

xrepo/packages/l/lua/port/lua/src/ltable.c:756–769  ·  view source on GitHub ↗

** search function for short strings */

Source from the content-addressed store, hash-verified

754** search function for short strings
755*/
756const TValue *luaH_getshortstr (Table *t, TString *key) {
757 Node *n = hashstr(t, key);
758 lua_assert(key->tt == LUA_VSHRSTR);
759 for (;;) { /* check whether 'key' is somewhere in the chain */
760 if (keyisshrstr(n) && eqshrstr(keystrval(n), key))
761 return gval(n); /* that's it */
762 else {
763 int nx = gnext(n);
764 if (nx == 0)
765 return &absentkey; /* not found */
766 n += nx;
767 }
768 }
769}
770
771
772const TValue *luaH_getstr (Table *t, TString *key) {

Callers 5

luaT_gettmFunction · 0.85
luaT_gettmbyobjFunction · 0.85
luaT_objtypenameFunction · 0.85
luaH_getstrFunction · 0.85
luaH_getFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected