MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / luaH_getshortstr

Function luaH_getshortstr

src/Chain/libraries/glua/ltable.cpp:654–668  ·  view source on GitHub ↗

** search function for short strings */

Source from the content-addressed store, hash-verified

652** search function for short strings
653*/
654const TValue *luaH_getshortstr(Table *t, TString *key) {
655 Node *n = hashstr(t, key);
656 lua_assert(key->tt == LUA_TSHRSTR);
657 for (;;) { /* check whether 'key' is somewhere in the chain */
658 const TValue *k = gkey(n);
659 if (ttisshrstring(k) && eqshrstr(tsvalue(k), key))
660 return gval(n); /* that's it */
661 else {
662 int nx = gnext(n);
663 if (nx == 0)
664 return luaO_nilobject; /* not found */
665 n += nx;
666 }
667 }
668}
669
670
671/*

Callers 4

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

Calls

no outgoing calls

Tested by

no test coverage detected