1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 14:21:31 +03:00

Compute accurately-sized empty state for diff steps.

This commit is contained in:
Rob Rix 2017-03-13 12:11:31 -04:00
parent e7eb4aab0f
commit c2a3649cff

View File

@ -193,8 +193,8 @@ data MyersState = MyersState { forward :: !(Vector.Vector Int), backward :: !(Ve
emptyStateForStep :: Myers a b -> MyersState emptyStateForStep :: Myers a b -> MyersState
emptyStateForStep step = case step of emptyStateForStep step = case step of
Return _ -> MyersState Vector.empty Vector.empty Then (M m) _ -> let EditGraph as bs = editGraph m in MyersState (Vector.replicate (length as) 0) (Vector.replicate (length bs) 0)
Then _ _ -> MyersState (Vector.replicate 100 0) (Vector.replicate 100 0) _ -> MyersState Vector.empty Vector.empty
setForward :: Vector.Vector Int -> Myers a () setForward :: Vector.Vector Int -> Myers a ()
setForward v = modify (\ s -> s { forward = v }) setForward v = modify (\ s -> s { forward = v })