Bryan O'Sullivan avatar Bryan O'Sullivan committed 412e113

Improve encoding performance by 5%

Comments (0)

Files changed (1)

Data/ByteString/Base64/Internal.hs

                   twoMore    = sp `plusPtr` 2 == sEnd
                   equals     = 0x3d :: Word8
                   {-# INLINE equals #-}
-              a <- peekSP 0 ((`shiftR` 2) . (.&. 0xfc))
-              b <- peekSP 0 ((`shiftL` 4) . (.&. 0x03))
+              !a <- peekSP 0 ((`shiftR` 2) . (.&. 0xfc))
+              !b <- peekSP 0 ((`shiftL` 4) . (.&. 0x03))
               !b' <- if twoMore
                      then peekSP 1 ((.|. b) . (`shiftR` 4) . (.&. 0xf0))
                      else return b
               poke8 dp =<< aidx a
               poke8 (dp `plusPtr` 1) =<< aidx b'
-              c <- if twoMore
-                   then aidx =<< peekSP 1 ((`shiftL` 2) . (.&. 0x0f))
-                   else return equals
+              !c <- if twoMore
+                    then aidx =<< peekSP 1 ((`shiftL` 2) . (.&. 0x0f))
+                    else return equals
               poke8 (dp `plusPtr` 2) c
               poke8 (dp `plusPtr` 3) equals
         withForeignPtr dfp $ \dptr ->
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.