Skip to content

Commit

Permalink
Fix tag_hash
Browse files Browse the repository at this point in the history
  • Loading branch information
hhugo committed Jul 27, 2015
1 parent 95f79dd commit 6e684be
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions syntax/common/utils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ let random_id length =
Garrigue's 1998 ML workshop paper.
*)
let tag_hash s =
let wrap = 0x40000000 in
let acc = ref 0 in
let len = String.length s in
for i = 0 to len - 1 do
Expand All @@ -232,7 +231,7 @@ let tag_hash s =
acc := (223 * !acc + n);
done;
acc := !acc land (1 lsl 31 - 1);
if !acc >= wrap then !acc - (1 lsl 31) else !acc
if !acc > 0x3fffffff then !acc - (1 lsl 31) else !acc

let _ =
(* Sanity check to make sure the function doesn't change underneath
Expand Down

0 comments on commit 6e684be

Please sign in to comment.