From c2a3649cff2a6b0cde886f5857a82da701916a5c Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 13 Mar 2017 12:11:31 -0400 Subject: [PATCH] Compute accurately-sized empty state for diff steps. --- src/SES/Myers.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SES/Myers.hs b/src/SES/Myers.hs index c66bc5b3e..eb8e20500 100644 --- a/src/SES/Myers.hs +++ b/src/SES/Myers.hs @@ -193,8 +193,8 @@ data MyersState = MyersState { forward :: !(Vector.Vector Int), backward :: !(Ve emptyStateForStep :: Myers a b -> MyersState emptyStateForStep step = case step of - Return _ -> MyersState Vector.empty Vector.empty - Then _ _ -> MyersState (Vector.replicate 100 0) (Vector.replicate 100 0) + Then (M m) _ -> let EditGraph as bs = editGraph m in MyersState (Vector.replicate (length as) 0) (Vector.replicate (length bs) 0) + _ -> MyersState Vector.empty Vector.empty setForward :: Vector.Vector Int -> Myers a () setForward v = modify (\ s -> s { forward = v })