From e77534c08f6470c01ee8be2b609422ef0834463b Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 11 Jun 1997 11:24:40 -0300 Subject: [PATCH] small 'improvement' --- tree.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tree.c b/tree.c index 4ed1641a..360d2159 100644 --- a/tree.c +++ b/tree.c @@ -3,7 +3,7 @@ ** TecCGraf - PUC-Rio */ -char *rcs_tree="$Id: tree.c,v 1.26 1997/05/14 18:38:29 roberto Exp roberto $"; +char *rcs_tree="$Id: tree.c,v 1.27 1997/06/09 17:28:14 roberto Exp roberto $"; #include @@ -39,9 +39,8 @@ static unsigned long hash (char *s, int tag) if (tag != LUA_T_STRING) h = (unsigned long)s; else { - long size = strlen(s); h = 0; - while (size--) + while (*s) h = ((h<<5)-h)^(unsigned char)*(s++); } return h;