MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / luaH_get

Function luaH_get

3rd/lua-5.4.3/src/ltable.c:777–791  ·  view source on GitHub ↗

** main search function */

Source from the content-addressed store, hash-verified

775** main search function
776*/
777const TValue *luaH_get (Table *t, const TValue *key) {
778 switch (ttypetag(key)) {
779 case LUA_VSHRSTR: return luaH_getshortstr(t, tsvalue(key));
780 case LUA_VNUMINT: return luaH_getint(t, ivalue(key));
781 case LUA_VNIL: return &absentkey;
782 case LUA_VNUMFLT: {
783 lua_Integer k;
784 if (luaV_flttointeger(fltvalue(key), &k, F2Ieq)) /* integral index? */
785 return luaH_getint(t, k); /* use specialized version */
786 /* else... */
787 } /* FALLTHROUGH */
788 default:
789 return getgeneric(t, key, 0);
790 }
791}
792
793
794/*

Callers 4

luaH_setFunction · 0.85
lua_rawgetFunction · 0.85
lua_rawgetpFunction · 0.85
addkFunction · 0.85

Calls 4

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

Tested by

no test coverage detected