Skip to content

Commit f51caa3

Browse files
committed
Optimise lazy filter
1 parent e2449f0 commit f51caa3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Data/Text/Lazy.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1683,7 +1683,7 @@ stripSuffix p t = reverse `fmap` stripPrefix (reverse p) (reverse t)
16831683
-- returns a 'Text' containing those characters that satisfy the
16841684
-- predicate.
16851685
filter :: (Char -> Bool) -> Text -> Text
1686-
filter p = foldrChunks (\t ts -> filter_ (\arr off l -> chunk (T.Text arr off l) ts) p t) Empty
1686+
filter p = foldrChunks (chunk . filter_ T.Text p) Empty
16871687
{-# INLINE [1] filter #-}
16881688

16891689
{-# RULES

0 commit comments

Comments
 (0)