MCPcopy Create free account
hub / github.com/DFHack/dfhack / luaH_get

Function luaH_get

depends/lua/src/ltable.c:589–603  ·  view source on GitHub ↗

** main search function */

Source from the content-addressed store, hash-verified

587** main search function
588*/
589const TValue *luaH_get (Table *t, const TValue *key) {
590 switch (ttype(key)) {
591 case LUA_TSHRSTR: return luaH_getshortstr(t, tsvalue(key));
592 case LUA_TNUMINT: return luaH_getint(t, ivalue(key));
593 case LUA_TNIL: return luaO_nilobject;
594 case LUA_TNUMFLT: {
595 lua_Integer k;
596 if (luaV_tointeger(key, &k, 0)) /* index is int? */
597 return luaH_getint(t, k); /* use specialized version */
598 /* else... */
599 } /* FALLTHROUGH */
600 default:
601 return getgeneric(t, key);
602 }
603}
604
605
606/*

Callers 3

luaH_setFunction · 0.85
lua_rawgetFunction · 0.85
lua_rawgetpFunction · 0.85

Calls 4

luaH_getshortstrFunction · 0.85
luaH_getintFunction · 0.85
luaV_tointegerFunction · 0.85
getgenericFunction · 0.85

Tested by

no test coverage detected