on master help sign in
Use unsafeTail in a few places, for speed

--HG-- extra : convert_revision : 8e6332f9266a4228fb096941df1904433485e78a

commit0099c104fe28ae24c3ef5618857387c69e7e74d4 authorBryan O'Sullivan <bos@serpentine.com> dateMon 23 Feb 2009, 01:55 (18 years ago) parent6818295
1 file changed+2−2
Data/Text.hs+2−2
Data/Text.hs+2−2
@@ -725,7 +725,7 @@ inits t@(Text arr off len) = loop 0
725725-- first.
726726tails :: Text -> [Text]
727727tails t | null t = [empty]
728− | otherwise = t : tails (tail t)
728+ | otherwise = t : tails (unsafeTail t)
729729
730730-- | /O(n)/ Break a 'Text' into pieces separated by the 'Char'
731731-- argument, consuming the delimiter. I.e.
@@ -821,7 +821,7 @@ breakSubstring pat src = search 0 src
821821 search !n !s
822822 | null s = (src,empty) -- not found
823823 | pat `isPrefixOf` s = (take n src,s)
824− | otherwise = search (n+1) (tail s)
824+ | otherwise = search (n+1) (unsafeTail s)
825825{-# INLINE breakSubstring #-}
826826
827827-- | /O(n)/ 'filter', applied to a predicate and a 'Text',