1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 04:51:57 +03:00

Over-allocate the state vectors by one place.

This commit is contained in:
Rob Rix 2017-03-13 17:58:49 -04:00
parent 5b17eac69d
commit 22aa2e6aba

View File

@ -226,7 +226,7 @@ emptyStateForStep step = case step of
n = length as
m = length bs
maxD = (m + n) `ceilDiv` 2
in MyersState (Vector.replicate (maxD * 2) 0) (Vector.replicate (maxD * 2) 0)
in MyersState (Vector.replicate (succ (maxD * 2)) 0) (Vector.replicate (succ (maxD * 2)) 0)
_ -> MyersState Vector.empty Vector.empty
setForward :: Vector.Vector Int -> Myers a ()