Skip to content

Commit

Permalink
Merge pull request #177 from kuk0/takeEnd
Browse files Browse the repository at this point in the history
fix takeEnd and dropEnd - issue #176
  • Loading branch information
bos committed May 21, 2017
2 parents 831626d + 01bcbbe commit c29d57c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Data/Text.hs
Expand Up @@ -1099,8 +1099,8 @@ takeEnd n t@(Text arr off len)
iterNEnd :: Int -> Text -> Int
iterNEnd n t@(Text _arr _off len) = loop (len-1) n
where loop i !m
| m <= 0 = i+1
| i <= 0 = 0
| m <= 1 = i
| otherwise = loop (i+d) (m-1)
where d = reverseIter_ t i

Expand Down

0 comments on commit c29d57c

Please sign in to comment.