]> git.alrj.org Git - bold.git/blobdiff - Bold/linker.py
Correct stupid bug, use a simple hash function.
[bold.git] / Bold / linker.py
index 8bc170a293c2f0b944ae3527232094399b13242c..8549066805cd43843416c529edba77cb3bad5a60 100644 (file)
@@ -26,7 +26,7 @@ def hash_name(name):
   """Caculate the hash of the function name."""
   h = 0
   for c in name:
-    h = (ord(c) - h + (h << 6) + (h << 16) & 0xffffffff)
+    h = ((h * 0x21) ^ ord(c)) & 0xffffffff
   return h
 
 class BoldLinker(object):