X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Futils%2FFastString.lhs;h=29c7788c2fbc3114eabb2cf35ea116306cdd9ac9;hb=af5a8f955fffa6c3d6b5c7f6552cee191e02c4d8;hp=cf4e37d21def58e6eb6491e8899c526825146886;hpb=9ef40dc2a0b3e06c8f38ed4c080c4d7dfe579f37;p=ghc-hetmet.git diff --git a/compiler/utils/FastString.lhs b/compiler/utils/FastString.lhs index cf4e37d..29c7788 100644 --- a/compiler/utils/FastString.lhs +++ b/compiler/utils/FastString.lhs @@ -103,7 +103,12 @@ import Data.IORef ( IORef, newIORef, readIORef, writeIORef ) import Data.Maybe ( isJust ) import Data.Char ( ord ) -import GHC.IOBase ( IO(..) ) +#if __GLASGOW_HASKELL__ >= 611 +import GHC.IO ( IO(..) ) +#else +import GHC.IOBase ( IO(..) ) +#endif + import GHC.Ptr ( Ptr(..) ) #if defined(__GLASGOW_HASKELL__) import GHC.Base ( unpackCString# ) @@ -380,9 +385,9 @@ hashStr (Ptr a#) (I# len#) = loop 0# 0# where loop h n | n GHC.Exts.==# len# = I# h | otherwise = loop h2 (n GHC.Exts.+# 1#) - where c = ord# (indexCharOffAddr# a# n) - h2 = (c GHC.Exts.+# (h GHC.Exts.*# 128#)) `remInt#` - hASH_TBL_SIZE# + where !c = ord# (indexCharOffAddr# a# n) + !h2 = (c GHC.Exts.+# (h GHC.Exts.*# 128#)) `remInt#` + hASH_TBL_SIZE# -- ----------------------------------------------------------------------------- -- Operations