[commit: ghc] wip/alexbiehl: Rewrite modulo hASH_TBL_SIZE (killed some transformation) (73656e6)

git at git.haskell.org git at git.haskell.org
Thu Mar 23 19:52:15 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/alexbiehl
Link       : http://ghc.haskell.org/trac/ghc/changeset/73656e67d777e942b4e977f25cf803959ae4433f/ghc

>---------------------------------------------------------------

commit 73656e67d777e942b4e977f25cf803959ae4433f
Author: alexbiehl <alex.biehl at gmail.com>
Date:   Thu Mar 23 20:52:01 2017 +0100

    Rewrite modulo hASH_TBL_SIZE (killed some transformation)


>---------------------------------------------------------------

73656e67d777e942b4e977f25cf803959ae4433f
 compiler/utils/FastString.hs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/compiler/utils/FastString.hs b/compiler/utils/FastString.hs
index b094670..545bfd1 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#)



More information about the ghc-commits mailing list