diff options
| -rw-r--r-- | tree.c | 5 |
1 files changed, 2 insertions, 3 deletions
| @@ -3,7 +3,7 @@ | |||
| 3 | ** TecCGraf - PUC-Rio | 3 | ** TecCGraf - PUC-Rio |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | char *rcs_tree="$Id: tree.c,v 1.26 1997/05/14 18:38:29 roberto Exp roberto $"; | 6 | char *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; |
