MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / getgeneric

Function getgeneric

lib/lua/src/ltable.c:299–311  ·  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

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

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