Fix a nasty off-by-one error.
--HG--
extra : convert_revision : d4de73d28d96ca399771163e15ba13bbede5c63b
commit5f475ca2528ca1fa2b5d2f932cb0e7a8c437d87a
authorBryan O'Sullivan <bos@serpentine.com>
dateTue 6 Oct 2009, 18:37 (17 years ago)
parentf8e8603
Data/Text/Search.hs+1−1
@@ -64,7 +64,7 @@ indices _needle@(Text narr noff nlen) _haystack@(Text harr hoff hlen)
6464 swizzle k = 1 `shiftL` (fromIntegral k .&. 0x3f)
6565 scan !i
6666 | i > ldiff = []
67− | c == z && candidateMatch 0 = i : scan (i + nlast)
67+ | c == z && candidateMatch 0 = i : scan (i + nlen)
6868 | otherwise = scan (i + delta)
6969 where c = hindex (i + nlast)
7070 candidateMatch !j