Skip to content

Commit

Permalink
Remove some dead branches from toStrict (#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
clyring committed Jun 5, 2023
1 parent 6641404 commit f2e33c0
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions Data/ByteString/Lazy/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,10 @@ toStrict = \cs -> goLen0 cs cs
where
-- It's still possible that the result is empty
goLen0 _ Empty = S.BS S.nullForeignPtr 0
goLen0 cs0 (Chunk (S.BS _ 0) cs) = goLen0 cs0 cs
goLen0 cs0 (Chunk c cs) = goLen1 cs0 c cs

-- It's still possible that the result is a single chunk
goLen1 _ bs Empty = bs
goLen1 cs0 bs (Chunk (S.BS _ 0) cs) = goLen1 cs0 bs cs
goLen1 cs0 (S.BS _ bl) (Chunk (S.BS _ cl) cs) =
goLen cs0 (S.checkedAdd "Lazy.toStrict" bl cl) cs

Expand Down

0 comments on commit f2e33c0

Please sign in to comment.