summaryrefslogtreecommitdiff
path: root/lib/libkeynote/auxil.c
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-01-30 06:32:03 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-01-30 06:32:03 +0000
commit2707bd60727cf017e98fb7e73be19e2799af7ba8 (patch)
tree9f632252e14ef05260c58fda4040dddafc0a7023 /lib/libkeynote/auxil.c
parent4090d6a41f6babe4b265cf5bf8f6cc327564597a (diff)
Remove bogus ~ from keynote_stringhash() which resulted in all
assertions being placed in the same hash bucket (--> potentially bad performance when creating sessions with many assertions/credentials, but no correctness errors).
Diffstat (limited to 'lib/libkeynote/auxil.c')
-rw-r--r--lib/libkeynote/auxil.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/libkeynote/auxil.c b/lib/libkeynote/auxil.c
index e301cb24171..7aba68f90a8 100644
--- a/lib/libkeynote/auxil.c
+++ b/lib/libkeynote/auxil.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auxil.c,v 1.1 2000/01/25 09:08:11 angelos Exp $ */
+/* $OpenBSD: auxil.c,v 1.2 2000/01/30 06:32:02 angelos Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu)
*
@@ -505,9 +505,6 @@ keynote_free_assertion(struct assertion *as)
free(as);
}
-/*
- * Taken from "Compiler Design in C" by Aho.
- */
u_int
keynote_stringhash(char *name, u_int size)
{
@@ -520,8 +517,8 @@ keynote_stringhash(char *name, u_int size)
for (; *name; name++)
{
hash_val = (hash_val << 2) + *name;
- if ((i = hash_val & 0x3fff))
- hash_val = ((hash_val ^ (i >> 12)) & ~0x3fff);
+ if (i = hash_val & 0x3fff)
+ hash_val = ((hash_val ^ (i >> 12)) & 0x3fff);
}
return hash_val % size;