mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 05:01:29 +00:00
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lstring.c,v 2.24 2012/05/11 14:14:42 roberto Exp $
|
||||
** $Id: lstring.c,v 2.26 2013/01/08 13:50:10 roberto Exp $
|
||||
** String table (keeps all strings handled by Lua)
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@@ -49,7 +49,7 @@ int luaS_eqstr (TString *a, TString *b) {
|
||||
|
||||
|
||||
unsigned int luaS_hash (const char *str, size_t l, unsigned int seed) {
|
||||
unsigned int h = seed ^ l;
|
||||
unsigned int h = seed ^ cast(unsigned int, l);
|
||||
size_t l1;
|
||||
size_t step = (l >> LUAI_HASHLIMIT) + 1;
|
||||
for (l1 = l; l1 >= step; l1 -= step)
|
||||
@@ -139,7 +139,7 @@ static TString *internshrstr (lua_State *L, const char *str, size_t l) {
|
||||
o = gch(o)->next) {
|
||||
TString *ts = rawgco2ts(o);
|
||||
if (h == ts->tsv.hash &&
|
||||
ts->tsv.len == l &&
|
||||
l == ts->tsv.len &&
|
||||
(memcmp(str, getstr(ts), l * sizeof(char)) == 0)) {
|
||||
if (isdead(G(L), o)) /* string is dead (but was not collected yet)? */
|
||||
changewhite(o); /* resurrect it */
|
||||
|
||||
Reference in New Issue
Block a user