MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaH_getint

Function luaH_getint

third-party/lua-5.2.4/src/ltable.c:446–460  ·  view source on GitHub ↗

** search function for integers */

Source from the content-addressed store, hash-verified

444** search function for integers
445*/
446const TValue *luaH_getint (Table *t, int key) {
447 /* (1 <= key && key <= t->sizearray) */
448 if (cast(unsigned int, key-1) < cast(unsigned int, t->sizearray))
449 return &t->array[key-1];
450 else {
451 lua_Number nk = cast_num(key);
452 Node *n = hashnum(t, nk);
453 do { /* check whether `key' is somewhere in the chain */
454 if (ttisnumber(gkey(n)) && luai_numeq(nvalue(gkey(n)), nk))
455 return gval(n); /* that's it */
456 else n = gnext(n);
457 } while (n);
458 return luaO_nilobject;
459 }
460}
461
462
463/*

Callers 7

luaH_getFunction · 0.70
luaH_setintFunction · 0.70
unbound_searchFunction · 0.70
lua_getglobalFunction · 0.70
lua_rawgetiFunction · 0.70
lua_setglobalFunction · 0.70
lua_loadFunction · 0.70

Calls 1

hashnumFunction · 0.70

Tested by

no test coverage detected