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

Function getgeneric

depends/lua/src/ltable.c:560–572  ·  view source on GitHub ↗

** "Generic" get version. (Not that generic: not valid for integers, ** which may be in array part, nor for floats with integral values.) */

Source from the content-addressed store, hash-verified

558** which may be in array part, nor for floats with integral values.)
559*/
560static const TValue *getgeneric (Table *t, const TValue *key) {
561 Node *n = mainposition(t, key);
562 for (;;) { /* check whether 'key' is somewhere in the chain */
563 if (luaV_rawequalobj(gkey(n), key))
564 return gval(n); /* that's it */
565 else {
566 int nx = gnext(n);
567 if (nx == 0)
568 return luaO_nilobject; /* not found */
569 n += nx;
570 }
571 }
572}
573
574
575const TValue *luaH_getstr (Table *t, TString *key) {

Callers 2

luaH_getstrFunction · 0.85
luaH_getFunction · 0.85

Calls 1

mainpositionFunction · 0.85

Tested by

no test coverage detected