** main search function */
| 784 | ** main search function |
| 785 | */ |
| 786 | const 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 | /* |
no test coverage detected