MCPcopy Create free account
hub / github.com/DFHack/dfhack / luaH_getshortstr

Function luaH_getshortstr

depends/lua/src/ltable.c:539–553  ·  view source on GitHub ↗

** search function for short strings */

Source from the content-addressed store, hash-verified

537** search function for short strings
538*/
539const TValue *luaH_getshortstr (Table *t, TString *key) {
540 Node *n = hashstr(t, key);
541 lua_assert(key->tt == LUA_TSHRSTR);
542 for (;;) { /* check whether 'key' is somewhere in the chain */
543 const TValue *k = gkey(n);
544 if (ttisshrstring(k) && eqshrstr(tsvalue(k), key))
545 return gval(n); /* that's it */
546 else {
547 int nx = gnext(n);
548 if (nx == 0)
549 return luaO_nilobject; /* not found */
550 n += nx;
551 }
552 }
553}
554
555
556/*

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