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