** main search function */
| 587 | ** main search function |
| 588 | */ |
| 589 | const TValue *luaH_get (Table *t, const TValue *key) { |
| 590 | switch (ttype(key)) { |
| 591 | case LUA_TSHRSTR: return luaH_getshortstr(t, tsvalue(key)); |
| 592 | case LUA_TNUMINT: return luaH_getint(t, ivalue(key)); |
| 593 | case LUA_TNIL: return luaO_nilobject; |
| 594 | case LUA_TNUMFLT: { |
| 595 | lua_Integer k; |
| 596 | if (luaV_tointeger(key, &k, 0)) /* index is int? */ |
| 597 | return luaH_getint(t, k); /* use specialized version */ |
| 598 | /* else... */ |
| 599 | } /* FALLTHROUGH */ |
| 600 | default: |
| 601 | return getgeneric(t, key); |
| 602 | } |
| 603 | } |
| 604 | |
| 605 | |
| 606 | /* |
no test coverage detected