summaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
Diffstat (limited to 'st.c')
-rw-r--r--st.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/st.c b/st.c
index 1cc0e2f4d7..753dce9a02 100644
--- a/st.c
+++ b/st.c
@@ -536,10 +536,14 @@ strhash(string)
register int val = 0;
while ((c = *string++) != '\0') {
- val = val*33 + c;
+ val += c;
+ val += (val << 10);
+ val ^= (val >> 6);
}
+ val += (val << 3);
+ val ^= (val >> 11);
- return val + (val>>5);
+ return val + (val << 15);
#else
register int val = 0;