** search function for short strings */
| 537 | ** search function for short strings |
| 538 | */ |
| 539 | const TValue *luaH_getshortstr (Table *t, TString *key) { |
| 540 | Node *n = hashstr(t, key); |
| 541 | lua_assert(key->tt == LUA_TSHRSTR); |
| 542 | for (;;) { /* check whether 'key' is somewhere in the chain */ |
| 543 | const TValue *k = gkey(n); |
| 544 | if (ttisshrstring(k) && eqshrstr(tsvalue(k), key)) |
| 545 | return gval(n); /* that's it */ |
| 546 | else { |
| 547 | int nx = gnext(n); |
| 548 | if (nx == 0) |
| 549 | return luaO_nilobject; /* not found */ |
| 550 | n += nx; |
| 551 | } |
| 552 | } |
| 553 | } |
| 554 | |
| 555 | |
| 556 | /* |
no outgoing calls
no test coverage detected