diff options
Diffstat (limited to 'lstring.c')
| -rw-r--r-- | lstring.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lstring.c,v 2.61 2017/12/12 11:52:35 roberto Exp roberto $ | 2 | ** $Id: lstring.c,v 2.62 2017/12/18 13:00:57 roberto Exp roberto $ |
| 3 | ** String table (keeps all strings handled by Lua) | 3 | ** String table (keeps all strings handled by Lua) |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -51,7 +51,7 @@ int luaS_eqlngstr (TString *a, TString *b) { | |||
| 51 | 51 | ||
| 52 | 52 | ||
| 53 | unsigned int luaS_hash (const char *str, size_t l, unsigned int seed) { | 53 | unsigned int luaS_hash (const char *str, size_t l, unsigned int seed) { |
| 54 | unsigned int h = seed ^ cast(unsigned int, l); | 54 | unsigned int h = seed ^ cast_uint(l); |
| 55 | size_t step = (l >> LUAI_HASHLIMIT) + 1; | 55 | size_t step = (l >> LUAI_HASHLIMIT) + 1; |
| 56 | for (; l >= step; l -= step) | 56 | for (; l >= step; l -= step) |
| 57 | h ^= ((h<<5) + (h>>2) + cast_byte(str[l - 1])); | 57 | h ^= ((h<<5) + (h>>2) + cast_byte(str[l - 1])); |
