** equality for long strings */
| 32 | ** equality for long strings |
| 33 | */ |
| 34 | int luaS_eqlngstr (TString *a, TString *b) { |
| 35 | size_t len = a->u.lnglen; |
| 36 | lua_assert(a->tt == LUA_VLNGSTR && b->tt == LUA_VLNGSTR); |
| 37 | return (a == b) || /* same instance or... */ |
| 38 | ((len == b->u.lnglen) && /* equal length and ... */ |
| 39 | (memcmp(getlngstr(a), getlngstr(b), len) == 0)); /* equal contents */ |
| 40 | } |
| 41 | |
| 42 | |
| 43 | unsigned int luaS_hash (const char *str, size_t l, unsigned int seed) { |
no outgoing calls
no test coverage detected