MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / luaH_get

Function luaH_get

xrepo/packages/l/lua/port/lua/src/ltable.c:786–800  ·  view source on GitHub ↗

** main search function */

Source from the content-addressed store, hash-verified

784** main search function
785*/
786const TValue *luaH_get (Table *t, const TValue *key) {
787 switch (ttypetag(key)) {
788 case LUA_VSHRSTR: return luaH_getshortstr(t, tsvalue(key));
789 case LUA_VNUMINT: return luaH_getint(t, ivalue(key));
790 case LUA_VNIL: return &absentkey;
791 case LUA_VNUMFLT: {
792 lua_Integer k;
793 if (luaV_flttointeger(fltvalue(key), &k, F2Ieq)) /* integral index? */
794 return luaH_getint(t, k); /* use specialized version */
795 /* else... */
796 } /* FALLTHROUGH */
797 default:
798 return getgeneric(t, key, 0);
799 }
800}
801
802
803/*

Callers 4

luaH_setFunction · 0.70
lua_rawgetFunction · 0.70
lua_rawgetpFunction · 0.70
addkFunction · 0.70

Calls 4

luaH_getshortstrFunction · 0.85
luaH_getintFunction · 0.85
luaV_flttointegerFunction · 0.85
getgenericFunction · 0.85

Tested by

no test coverage detected