summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authorErik Hovland <erik@hovland.org>2008-12-16 12:53:19 -0800
committerErik Hovland <erik@hovland.org>2008-12-16 12:53:19 -0800
commitd2d40793765c6e115bea995701d40dcf9b65da2d (patch)
tree9557cebc4edc7f92ecf7572ff98ca535126c5684 /hash.c
parent170e6907b9761afcfebad30d9876fa43804bd5fd (diff)
Remove redundant int clamping
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/hash.c b/hash.c
index d872f61d..97a9eb4f 100644
--- a/hash.c
+++ b/hash.c
@@ -32,17 +32,11 @@ int hash_string (const unsigned char *s, int n)
{
unsigned int h = 0;
-#if 0
- while (*s)
- h += *s++;
-#else
while (*s)
h += (h << 7) + *s++;
h = (h * SOMEPRIME) % n;
- h = (h >= 0) ? h : h + n;
-#endif
- return (signed) (h % n);
+ return (signed) h;
}
HASH *hash_create (int nelem)