** main search function */
| 775 | ** main search function |
| 776 | */ |
| 777 | const 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 | /* |
no test coverage detected