mirror of
https://github.com/RTimothyEdwards/netgen.git
synced 2026-08-22 14:07:07 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1520e276bc | ||
|
|
665203bba1 |
+3
-1
@@ -164,8 +164,10 @@ unsigned long hashcase(char *s, int hashsize)
|
||||
unsigned long genhash(char *s, int c, int hashsize)
|
||||
{
|
||||
unsigned long hashval = 2166136261ul;
|
||||
hashval ^= (unsigned long)c;
|
||||
hashval *= 16777619ul;
|
||||
for (; *s != '\0'; s++) {
|
||||
hashval ^= (unsigned long)c;
|
||||
hashval ^= (unsigned char)(*s);
|
||||
hashval *= 16777619ul;
|
||||
}
|
||||
return (hashsize == 0) ? hashval : (hashval % hashsize);
|
||||
|
||||
Reference in New Issue
Block a user