Commit 66e2bd09 authored by Bodigrim's avatar Bodigrim
Browse files

Review suggestions

parent ca9bee8d
......@@ -45,9 +45,7 @@ import System.Posix.Types (CSsize(..))
data T = {-# UNPACK #-} !Word64 :* {-# UNPACK #-} !Int
-- | /O(n+m)/ Find the offsets of all non-overlapping indices of
-- @needle@ within @haystack@. The offsets returned represent
-- uncorrected indices in the low-level \"needle\" array, to which its
-- offset must be added.
-- @needle@ within @haystack@.
--
-- In (unlikely) bad cases, this algorithm's complexity degrades
-- towards /O(n*m)/.
......@@ -66,7 +64,7 @@ indices' (Text narr noff nlen) (Text harr@(A.ByteArray harr#) hoff hlen) = loop
where
nlast = nlen - 1
!z = nindex nlast
nindex k = if k < 0 then 0 else A.unsafeIndex narr (noff+k)
nindex k = A.unsafeIndex narr (noff+k)
buildTable !i !msk !skp
| i >= nlast = (msk .|. swizzle z) :* skp
| otherwise = buildTable (i+1) (msk .|. swizzle c) skp'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment