[karp-rabin] replace take-drop with array slice

parent eb9b9bc0
......@@ -183,7 +183,7 @@ strictMatcher { hash, hashMap, hLen, pats, rehash } = unsafePartial search
-- | Sliding window of substrings. Note that we need to
-- | add the last one.
window :: Array (Array CodePoint)
window = slidingWindow arr (hLen + 1) <> [A.take hLen $ A.drop maxIdx arr]
window = slidingWindow arr (hLen + 1) <> [A.slice maxIdx (maxIdx + hLen) arr]
strLen = S.length str
maxIdx = strLen - hLen
arr = S.toCodePointArray str
......
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