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

Function getgeneric

extlibs/lua/src/ltable.c:255–267  ·  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

253** which may be in array part, nor for floats with integral values.)
254*/
255static const TValue *getgeneric (Table *t, const TValue *key) {
256 Node *n = mainpositionTV(t, key);
257 for (;;) { /* check whether 'key' is somewhere in the chain */
258 if (equalkey(key, n))
259 return gval(n); /* that's it */
260 else {
261 int nx = gnext(n);
262 if (nx == 0)
263 return &absentkey; /* not found */
264 n += nx;
265 }
266 }
267}
268
269
270/*

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