diff options
Diffstat (limited to 'lstring.c')
| -rw-r--r-- | lstring.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -40,7 +40,7 @@ int luaS_eqlngstr (TString *a, TString *b) { | |||
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | 42 | ||
| 43 | unsigned int luaS_hash (const char *str, size_t l, unsigned int seed) { | 43 | unsigned luaS_hash (const char *str, size_t l, unsigned seed) { |
| 44 | unsigned int h = seed ^ cast_uint(l); | 44 | unsigned int h = seed ^ cast_uint(l); |
| 45 | for (; l > 0; l--) | 45 | for (; l > 0; l--) |
| 46 | h ^= ((h<<5) + (h>>2) + cast_byte(str[l - 1])); | 46 | h ^= ((h<<5) + (h>>2) + cast_byte(str[l - 1])); |
| @@ -48,7 +48,7 @@ unsigned int luaS_hash (const char *str, size_t l, unsigned int seed) { | |||
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | 50 | ||
| 51 | unsigned int luaS_hashlongstr (TString *ts) { | 51 | unsigned luaS_hashlongstr (TString *ts) { |
| 52 | lua_assert(ts->tt == LUA_VLNGSTR); | 52 | lua_assert(ts->tt == LUA_VLNGSTR); |
| 53 | if (ts->extra == 0) { /* no hash? */ | 53 | if (ts->extra == 0) { /* no hash? */ |
| 54 | size_t len = ts->u.lnglen; | 54 | size_t len = ts->u.lnglen; |
| @@ -155,7 +155,7 @@ size_t luaS_sizelngstr (size_t len, int kind) { | |||
| 155 | ** creates a new string object | 155 | ** creates a new string object |
| 156 | */ | 156 | */ |
| 157 | static TString *createstrobj (lua_State *L, size_t totalsize, int tag, | 157 | static TString *createstrobj (lua_State *L, size_t totalsize, int tag, |
| 158 | unsigned int h) { | 158 | unsigned h) { |
| 159 | TString *ts; | 159 | TString *ts; |
| 160 | GCObject *o; | 160 | GCObject *o; |
| 161 | o = luaC_newobj(L, tag, totalsize); | 161 | o = luaC_newobj(L, tag, totalsize); |
