** main search function */
| 801 | ** main search function |
| 802 | */ |
| 803 | const TValue *luaH_get (Table *t, const TValue *key) { |
| 804 | switch (ttypetag(key)) { |
| 805 | case LUA_VSHRSTR: return luaH_getshortstr(t, tsvalue(key)); |
| 806 | case LUA_VNUMINT: return luaH_getint(t, ivalue(key)); |
| 807 | case LUA_VNIL: return &absentkey; |
| 808 | case LUA_VNUMFLT: { |
| 809 | lua_Integer k; |
| 810 | if (luaV_flttointeger(fltvalue(key), &k, F2Ieq)) /* integral index? */ |
| 811 | return luaH_getint(t, k); /* use specialized version */ |
| 812 | /* else... */ |
| 813 | } /* FALLTHROUGH */ |
| 814 | default: |
| 815 | return getgeneric(t, key, 0); |
| 816 | } |
| 817 | } |
| 818 | |
| 819 | |
| 820 | /* |
no test coverage detected