** search function for short strings */
| 652 | ** search function for short strings |
| 653 | */ |
| 654 | const TValue *luaH_getshortstr(Table *t, TString *key) { |
| 655 | Node *n = hashstr(t, key); |
| 656 | lua_assert(key->tt == LUA_TSHRSTR); |
| 657 | for (;;) { /* check whether 'key' is somewhere in the chain */ |
| 658 | const TValue *k = gkey(n); |
| 659 | if (ttisshrstring(k) && eqshrstr(tsvalue(k), key)) |
| 660 | return gval(n); /* that's it */ |
| 661 | else { |
| 662 | int nx = gnext(n); |
| 663 | if (nx == 0) |
| 664 | return luaO_nilobject; /* not found */ |
| 665 | n += nx; |
| 666 | } |
| 667 | } |
| 668 | } |
| 669 | |
| 670 | |
| 671 | /* |
no outgoing calls
no test coverage detected