MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / luaH_getshortstr

Function luaH_getshortstr

3rd/lua-5.4.3/src/ltable.c:747–760  ·  view source on GitHub ↗

** search function for short strings */

Source from the content-addressed store, hash-verified

745** search function for short strings
746*/
747const TValue *luaH_getshortstr (Table *t, TString *key) {
748 Node *n = hashstr(t, key);
749 lua_assert(key->tt == LUA_VSHRSTR);
750 for (;;) { /* check whether 'key' is somewhere in the chain */
751 if (keyisshrstr(n) && eqshrstr(keystrval(n), key))
752 return gval(n); /* that's it */
753 else {
754 int nx = gnext(n);
755 if (nx == 0)
756 return &absentkey; /* not found */
757 n += nx;
758 }
759 }
760}
761
762
763const 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