** main search function */
| 739 | ** main search function |
| 740 | */ |
| 741 | const TValue *luaH_get (Table *t, const TValue *key) { |
| 742 | switch (ttypetag(key)) { |
| 743 | case LUA_VSHRSTR: return luaH_getshortstr(t, tsvalue(key)); |
| 744 | case LUA_VNUMINT: return luaH_getint(t, ivalue(key)); |
| 745 | case LUA_VNIL: return &absentkey; |
| 746 | case LUA_VNUMFLT: { |
| 747 | lua_Integer k; |
| 748 | if (luaV_flttointeger(fltvalue(key), &k, F2Ieq)) /* integral index? */ |
| 749 | return luaH_getint(t, k); /* use specialized version */ |
| 750 | /* else... */ |
| 751 | } /* FALLTHROUGH */ |
| 752 | default: |
| 753 | return getgeneric(t, key); |
| 754 | } |
| 755 | } |
| 756 | |
| 757 | |
| 758 | /* |
no test coverage detected