on master help sign in
Data.Text: fix a bug in drop.
1cbdee0Nicolas Pouillard
Data/Text.hs+1−1
@@ -598,7 +598,7 @@ drop n t@(Text arr off len)
598 | otherwise = loop 0 0
598 | otherwise = loop 0 0
599 where end = off + len
599 where end = off + len
600 loop !i !cnt
600 loop !i !cnt
601− | i >= end || cnt >= n = Text arr (off+i) (len-i)
601+ | i >= len || cnt >= n = Text arr (off+i) (len-i)
602 | otherwise = loop (i+d) (cnt+1)
602 | otherwise = loop (i+d) (cnt+1)
603 where d = iter_ t i
603 where d = iter_ t i
604{-# INLINE [1] drop #-}
604{-# INLINE [1] drop #-}