@@ -741,11 +741,10 @@ split c = splitWith (==c)
741-- > splitWith (=='a') "aabbaca" == ["","","bb","c",""]
741-- > splitWith (=='a') "aabbaca" == ["","","bb","c",""]
742-- > splitWith (=='a') [] == []
742-- > splitWith (=='a') [] == []
743splitWith :: (Char -> Bool) -> Text -> [Text]
743splitWith :: (Char -> Bool) -> Text -> [Text]
744−splitWith p = loop
744+splitWith _ (Text _off _arr 0) = []
745+splitWith p t = loop t
745− where loop s | null s = []
746+ where loop s | null s' = [l]
746− | otherwise = if null s'
748− else l : loop (unsafeTail s')
747+ | otherwise = l : loop (unsafeTail s')
749 where (l, s') = break p s
748 where (l, s') = break p s
750{-# INLINE splitWith #-}
749{-# INLINE splitWith #-}