aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-06-11 11:24:40 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-06-11 11:24:40 -0300
commite77534c08f6470c01ee8be2b609422ef0834463b (patch)
treeb16354a17bb65e1a16e0298e9abdba15860a0096
parenta22b54bbb6a9b6a2f77d69af003f837fc553f3b3 (diff)
downloadlua-e77534c08f6470c01ee8be2b609422ef0834463b.tar.gz
lua-e77534c08f6470c01ee8be2b609422ef0834463b.tar.bz2
lua-e77534c08f6470c01ee8be2b609422ef0834463b.zip
small 'improvement'
-rw-r--r--tree.c5
1 files 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 @@
3** TecCGraf - PUC-Rio 3** TecCGraf - PUC-Rio
4*/ 4*/
5 5
6char *rcs_tree="$Id: tree.c,v 1.26 1997/05/14 18:38:29 roberto Exp roberto $"; 6char *rcs_tree="$Id: tree.c,v 1.27 1997/06/09 17:28:14 roberto Exp roberto $";
7 7
8 8
9#include <string.h> 9#include <string.h>
@@ -39,9 +39,8 @@ static unsigned long hash (char *s, int tag)
39 if (tag != LUA_T_STRING) 39 if (tag != LUA_T_STRING)
40 h = (unsigned long)s; 40 h = (unsigned long)s;
41 else { 41 else {
42 long size = strlen(s);
43 h = 0; 42 h = 0;
44 while (size--) 43 while (*s)
45 h = ((h<<5)-h)^(unsigned char)*(s++); 44 h = ((h<<5)-h)^(unsigned char)*(s++);
46 } 45 }
47 return h; 46 return h;