diff options
author | alexbiehl <alex.biehl@gmail.com> | 2017-03-23 20:52:01 +0100 |
---|---|---|
committer | alexbiehl <alex.biehl@gmail.com> | 2017-03-23 20:52:01 +0100 |
commit | 73656e67d777e942b4e977f25cf803959ae4433f (patch) | |
tree | 9cfd5c8043f80b15972e5d5a6bf3e0ac1b00429c | |
parent | 5748f7642e406ddf232fd49edf6366a3e4de8bf0 (diff) | |
download | haskell-73656e67d777e942b4e977f25cf803959ae4433f.tar.gz |
Rewrite modulo hASH_TBL_SIZE (killed some transformation)
-rw-r--r-- | compiler/utils/FastString.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/utils/FastString.hs b/compiler/utils/FastString.hs index b09467091d..545bfd122f 100644 --- a/compiler/utils/FastString.hs +++ b/compiler/utils/FastString.hs @@ -455,11 +455,11 @@ cmpStringPrefix ptr1 ptr2 len = return (r == 0) hashStr :: Ptr Word8 -> Int -> Int -hashStr (Ptr a#) (I# len#) = loop 0# a# .&. (hASH_TBL_SIZE - 1) +hashStr (Ptr a#) (I# len#) = loop 0# a# where !end = plusAddr# a# len# - loop h op | isTrue# (eqAddr# op end) = I# h + loop h op | isTrue# (eqAddr# op end) = I# h .&. (hASH_TBL_SIZE - 1) | otherwise = loop h' (plusAddr# op 1#) where !c = ord# (indexCharOffAddr# op 0#) |