Skip to content

Commit

Permalink
Merge pull request #21 from Lemmih/master
Browse files Browse the repository at this point in the history
Use S.foldl' on each chunk when strictly folding a lazy bytestring.
  • Loading branch information
dcoutts committed Nov 9, 2014
2 parents f37493f + e97df17 commit 39de720
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Data/ByteString/Lazy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ foldl' :: (a -> Word8 -> a) -> a -> ByteString -> a
foldl' f z = go z
where go a _ | a `seq` False = undefined
go a Empty = a
go a (Chunk c cs) = go (S.foldl f a c) cs
go a (Chunk c cs) = go (S.foldl' f a c) cs
{-# INLINE foldl' #-}

-- | 'foldr', applied to a binary operator, a starting value
Expand Down

0 comments on commit 39de720

Please sign in to comment.