Permalink
Browse files

Use checked bitshifts (fixes #4) -- this is safe w.r.t. optimizations.

  • Loading branch information...
1 parent e9cb5e0 commit d22bc51448ef771e0862c7c488f328e5bc9ea583 @gregorycollins committed Apr 20, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/Data/HashTable/Internal/Utils.hs
@@ -253,15 +253,15 @@ iShiftRL :: Int -> Int -> Int
--------------------------------------------------------------------}
{-# INLINE shiftRL #-}
shiftRL (W# x) (I# i)
- = W# (uncheckedShiftRL# x i)
+ = W# (shiftRL# x i)
{-# INLINE iShiftL #-}
iShiftL (I# x) (I# i)
- = I# (uncheckedIShiftL# x i)
+ = I# (iShiftL# x i)
{-# INLINE iShiftRL #-}
iShiftRL (I# x) (I# i)
- = I# (uncheckedIShiftRL# x i)
+ = I# (iShiftRL# x i)
#else
shiftRL x i = shiftR x i

0 comments on commit d22bc51

Please sign in to comment.