** main search function */
| 702 | ** main search function |
| 703 | */ |
| 704 | const TValue *luaH_get(Table *t, const TValue *key) { |
| 705 | switch (ttype(key)) { |
| 706 | case LUA_TSHRSTR: return luaH_getshortstr(t, tsvalue(key)); |
| 707 | case LUA_TNUMINT: return luaH_getint(t, ivalue(key)); |
| 708 | case LUA_TNIL: return luaO_nilobject; |
| 709 | case LUA_TNUMFLT: { |
| 710 | lua_Integer k; |
| 711 | if (luaV_tointeger(key, &k, 0)) /* index is int? */ |
| 712 | return luaH_getint(t, k); /* use specialized version */ |
| 713 | /* else... */ |
| 714 | } /* FALLTHROUGH */ |
| 715 | default: |
| 716 | return getgeneric(t, key); |
| 717 | } |
| 718 | } |
| 719 | |
| 720 | |
| 721 | /* |
no test coverage detected