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

Function getgeneric

xrepo/packages/l/lua/port/lua/src/ltable.c:297–309  ·  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.) ** See explanation about 'deadok' in function 'equalkey'. */

Source from the content-addressed store, hash-verified

295** See explanation about 'deadok' in function 'equalkey'.
296*/
297static const TValue *getgeneric (Table *t, const TValue *key, int deadok) {
298 Node *n = mainpositionTV(t, key);
299 for (;;) { /* check whether 'key' is somewhere in the chain */
300 if (equalkey(key, n, deadok))
301 return gval(n); /* that's it */
302 else {
303 int nx = gnext(n);
304 if (nx == 0)
305 return &absentkey; /* not found */
306 n += nx;
307 }
308 }
309}
310
311
312/*

Callers 3

findindexFunction · 0.85
luaH_getstrFunction · 0.85
luaH_getFunction · 0.85

Calls 2

mainpositionTVFunction · 0.85
equalkeyFunction · 0.85

Tested by

no test coverage detected