** search function for short strings */
| 518 | ** search function for short strings |
| 519 | */ |
| 520 | const TValue *luaH_getstr (Table *t, TString *key) { |
| 521 | Node *n = hashstr(t, key); |
| 522 | lua_assert(key->tt == LUA_TSHRSTR); |
| 523 | for (;;) { /* check whether 'key' is somewhere in the chain */ |
| 524 | const TValue *k = gkey(n); |
| 525 | if (ttisshrstring(k) && eqshrstr(tsvalue(k), key)) |
| 526 | return gval(n); /* that's it */ |
| 527 | else { |
| 528 | int nx = gnext(n); |
| 529 | if (nx == 0) break; |
| 530 | n += nx; |
| 531 | } |
| 532 | }; |
| 533 | return luaO_nilobject; |
| 534 | } |
| 535 | |
| 536 | |
| 537 | /* |
no outgoing calls
no test coverage detected