@@ -1164,13 +1164,8 @@ splitAt :: Int -> Text -> (Text, Text)
1164splitAt n t@(Text arr off len)
1164splitAt n t@(Text arr off len)
1165 | n <= 0 = (empty, t)
1165 | n <= 0 = (empty, t)
1166 | n >= len = (t, empty)
1166 | n >= len = (t, empty)
1167− | otherwise = (Text arr off k, Text arr (off+k) (len-k))
1167+ | otherwise = (text arr off k, text arr (off+k) (len-k))
1168− where k = loop 0 0
1168+ where k = iterN n t
1170− | i >= len || cnt >= n = i
1171− | otherwise = loop (i+d) (cnt+1)
1172− where d = iter_ t i
1173−{-# INLINE splitAt #-}
1175-- | /O(n)/ 'span', applied to a predicate @p@ and text @t@, returns
1170-- | /O(n)/ 'span', applied to a predicate @p@ and text @t@, returns
1176-- a pair whose first element is the longest prefix (possibly empty)
1171-- a pair whose first element is the longest prefix (possibly empty)