Skip to content
Browse files

Fix buildTable

On chunk boundaries, the character was not recorded and the global index not
incremented, causing issue #10.
  • Loading branch information...
1 parent 73d7013 commit 92da4299be59838295f83103c79a0c1b8f2e713c Daniel Fischer committed Oct 25, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 Data/Text/Lazy/Search.hs
View
2 Data/Text/Lazy/Search.hs
@@ -77,7 +77,7 @@ indices needle@(Chunk n ns) _haystack@(Chunk k ks)
go !(g::Int64) !i !msk !skp
| i >= xlast = case xs of
Empty -> (msk .|. swizzle z) :*: skp
- Chunk y ys -> buildTable y ys g 0 msk skp
+ Chunk y ys -> buildTable y ys (g+1) 0 (msk .|. swizzle c) skp'
| otherwise = go (g+1) (i+1) (msk .|. swizzle c) skp'
where c = A.unsafeIndex xarr (xoff+i)
skp' | c == z = nlen - fromIntegral g - 2

0 comments on commit 92da429

Please sign in to comment.
Something went wrong with that request. Please try again.