on master help sign in
fix takeEnd and dropEnd - issue #176
commit01bcbbed90159fba5235c1525257546e36a7dc81 authorKubo Kovac <kuko@fb.com> dateWed 3 May 2017, 21:23 (9 years ago) parent831626d
1 file changed+1−1
Data/Text.hs+1−1
Data/Text.hs+1−1
@@ -1099,8 +1099,8 @@ takeEnd n t@(Text arr off len)
10991099iterNEnd :: Int -> Text -> Int
11001100iterNEnd n t@(Text _arr _off len) = loop (len-1) n
11011101 where loop i !m
1102+ | m <= 0 = i+1
11021103 | i <= 0 = 0
1103− | m <= 1 = i
11041104 | otherwise = loop (i+d) (m-1)
11051105 where d = reverseIter_ t i
11061106