Skip to content

Commit

Permalink
The unsafeShiftR function also wasn't available before 7.2. :)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorycollins committed Sep 11, 2012
1 parent 5008bfe commit 494e672
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Snap/Internal/Test/RequestBuilder.hs
Expand Up @@ -239,8 +239,14 @@ makeBoundary = do

encode = toByteString . S8.foldl' f mempty

#if MIN_VERSION_base(4,5,0)
shR = unsafeShiftR
#else
shR = shiftR
#endif

f m c = let low = c .&. 0xf
hi = (c .&. 0xf0) `unsafeShiftR` 4
hi = (c .&. 0xf0) `shR` 4
k = \i -> fromWord8 $! toEnum $! fromEnum $!
V.unsafeIndex table (fromEnum i)
in m `mappend` k hi `mappend` k low
Expand Down

0 comments on commit 494e672

Please sign in to comment.