Skip to content

Commit

Permalink
Fix buildTable
Browse files Browse the repository at this point in the history
On chunk boundaries, the character was not recorded and the global index not
incremented, causing issue #10.
  • Loading branch information
Daniel Fischer committed Oct 25, 2011
1 parent 73d7013 commit 92da429
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Data/Text/Lazy/Search.hs
Expand Up @@ -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
Expand Down

0 comments on commit 92da429

Please sign in to comment.