Commits

dafis  committed 068e6fa

Fix buildTable

On chunk boundaries, the character was not recorded and the global index not
incremented, causing issue #10.

  • Participants
  • Parent commits c92862a

Comments (0)

Files changed (1)

File Data/Text/Lazy/Search.hs

         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