[commit: packages/bytestring] 0.10.4.x, master: Use S.foldl' on each chunk when strictly folding a lazy bytestring. (e97df17)
git at git.haskell.org
git at git.haskell.org
Fri Jan 23 22:42:12 UTC 2015
Repository : ssh://git@git.haskell.org/bytestring
On branches: 0.10.4.x,master
Link : http://git.haskell.org/packages/bytestring.git/commitdiff/e97df17c0c63dc2503e8e43b51a581f27166d04f
>---------------------------------------------------------------
commit e97df17c0c63dc2503e8e43b51a581f27166d04f
Author: Lemmih <lemmih at gmail.com>
Date: Sun May 11 16:04:57 2014 +0800
Use S.foldl' on each chunk when strictly folding a lazy bytestring.
>---------------------------------------------------------------
e97df17c0c63dc2503e8e43b51a581f27166d04f
Data/ByteString/Lazy.hs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Data/ByteString/Lazy.hs b/Data/ByteString/Lazy.hs
index 22ba1ee..aa1cee5 100644
--- a/Data/ByteString/Lazy.hs
+++ b/Data/ByteString/Lazy.hs
@@ -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
More information about the ghc-commits
mailing list