commit | de09caaa37b1b575660d2f9a22527325662afc41 | [log] [tgz] |
---|---|---|
author | Chris Angelico <rosuav@gmail.com> | Sat Jun 07 06:55:27 2014 +1000 |
committer | Chris Angelico <rosuav@gmail.com> | Sat Jun 07 07:06:18 2014 +1000 |
tree | c7aa52315763e170f5dda25e366c9267feb79e7a | |
parent | d72bc2713aa04ee5239e12a3df17ce9e50985e13 [diff] [blame] |
Bring the C and Python compute_hash functions into consistency
diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index 2ec5a1f..599b936 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py
@@ -27,7 +27,8 @@ hash = 5381 for char in qstr: hash = (hash * 33) ^ ord(char) - return hash & 0xffff + # Make sure that valid hash is never zero, zero means "hash not computed" + return (hash & 0xffff) or 1 def do_work(infiles): # read the qstrs in from the input files