MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / luaH_getint

Function luaH_getint

src/Chain/libraries/glua/ltable.cpp:631–648  ·  view source on GitHub ↗

** search function for integers */

Source from the content-addressed store, hash-verified

629** search function for integers
630*/
631const TValue *luaH_getint(Table *t, lua_Integer key) {
632 /* (1 <= key && key <= t->sizearray) */
633 if (l_castS2U(key) - 1 < t->sizearray)
634 return &t->array[key - 1];
635 else {
636 Node *n = hashint(t, key);
637 for (;;) { /* check whether 'key' is somewhere in the chain */
638 if (ttisinteger(gkey(n)) && ivalue(gkey(n)) == key)
639 return gval(n); /* that's it */
640 else {
641 int nx = gnext(n);
642 if (nx == 0) break;
643 n += nx;
644 }
645 }
646 return luaO_nilobject;
647 }
648}
649
650
651/*

Callers 8

luaH_getFunction · 0.85
luaH_setintFunction · 0.85
unbound_searchFunction · 0.85
lua_getglobalFunction · 0.85
lua_rawgetiFunction · 0.85
lua_setglobalFunction · 0.85
lua_loadFunction · 0.85
lua_load_with_checkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected