aboutsummaryrefslogtreecommitdiff
path: root/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'tree.c')
-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;