From: Don Stewart Date: Fri, 10 Nov 2006 02:12:54 +0000 (+0000) Subject: LPS chunk sizes should be 16 bytes, not 17. X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=3575737d44687dd6011c7fe600f5ce6d130321c2;p=haskell-directory.git LPS chunk sizes should be 16 bytes, not 17. --- diff --git a/Data/ByteString/Lazy.hs b/Data/ByteString/Lazy.hs index 6c45784..c9d3bdb 100644 --- a/Data/ByteString/Lazy.hs +++ b/Data/ByteString/Lazy.hs @@ -410,8 +410,8 @@ length (LPS ss) = L.foldl' (\n ps -> n + fromIntegral (P.length ps)) 0 ss -- You can however use 'repeat' and 'cycle' to build infinite lazy ByteStrings. -- cons :: Word8 -> ByteString -> ByteString -cons c (LPS (s:ss)) | P.length s <= 16 = LPS (P.cons c s : ss) -cons c (LPS ss) = LPS (P.singleton c : ss) +cons c (LPS (s:ss)) | P.length s < 16 = LPS (P.cons c s : ss) +cons c (LPS ss) = LPS (P.singleton c : ss) {-# INLINE cons #-} -- | /O(n\/c)/ Append a byte to the end of a 'ByteString'