Skip to content

Commit

Permalink
Remove useless INLINE on compareLength for lazy bytestrings. (#705)
Browse files Browse the repository at this point in the history
The function is self-recursive so will never inline.
I also don't see the benefit of the INLINE pragma in the first place.

Fixes #704.
  • Loading branch information
AndreasPK authored Mar 4, 2025
1 parent aca65b3 commit c63dd72
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion Data/ByteString/Lazy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,6 @@ compareLength :: ByteString -> Int64 -> Ordering
compareLength _ toCmp | toCmp < 0 = GT
compareLength Empty toCmp = compare 0 toCmp
compareLength (Chunk c cs) toCmp = compareLength cs (toCmp - fromIntegral (S.length c))
{-# INLINE compareLength #-}

{-# RULES
"ByteString.Lazy length/compareN -> compareLength" [~1] forall t n.
Expand Down

0 comments on commit c63dd72

Please sign in to comment.