MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / luaH_get

Function luaH_get

ThirdParty/lua/lua/ltable.c:540–565  ·  view source on GitHub ↗

** main search function */

Source from the content-addressed store, hash-verified

538** main search function
539*/
540const TValue *luaH_get (Table *t, const TValue *key) {
541 switch (ttype(key)) {
542 case LUA_TSHRSTR: return luaH_getstr(t, tsvalue(key));
543 case LUA_TNUMINT: return luaH_getint(t, ivalue(key));
544 case LUA_TNIL: return luaO_nilobject;
545 case LUA_TNUMFLT: {
546 lua_Integer k;
547 if (numisinteger(fltvalue(key), &k)) /* index is int? */
548 return luaH_getint(t, k); /* use specialized version */
549 /* else go through */
550 }
551 default: {
552 Node *n = mainposition(t, key);
553 for (;;) { /* check whether 'key' is somewhere in the chain */
554 if (luaV_rawequalobj(gkey(n), key))
555 return gval(n); /* that's it */
556 else {
557 int nx = gnext(n);
558 if (nx == 0) break;
559 n += nx;
560 }
561 };
562 return luaO_nilobject;
563 }
564 }
565}
566
567
568/*

Callers 5

luaV_gettableFunction · 0.85
luaV_settableFunction · 0.85
luaH_setFunction · 0.85
lua_rawgetFunction · 0.85
lua_rawgetpFunction · 0.85

Calls 4

luaH_getstrFunction · 0.85
luaH_getintFunction · 0.85
numisintegerFunction · 0.85
mainpositionFunction · 0.85

Tested by

no test coverage detected