From 6a4148fd6fe6a8c8ee072130df2de9163a8248bc Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 21 Jun 2017 11:57:50 -0400 Subject: [PATCH] s/negate/-/ --- src/SES/Myers.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/SES/Myers.hs b/src/SES/Myers.hs index 40ced8af6..33125dd0d 100644 --- a/src/SES/Myers.hs +++ b/src/SES/Myers.hs @@ -29,18 +29,18 @@ ses eq as' bs' -- Search an edit graph for the shortest edit script up to a given proposed edit distance, building on the results of previous searches. searchUpToD d v = - let endpoints = searchAlongK <$> [ k | k <- [negate d, negate d + 2 .. d], inRange (negate m, n) k ] in + let endpoints = searchAlongK <$> [ k | k <- [-d, -d + 2 .. d], inRange (negate m, n) k ] in case find isComplete endpoints of Just (Endpoint _ _ script) -> script - _ -> searchUpToD (succ d) (Array.array (negate d, d) ((\ e@(Endpoint x y _) -> (x - y, e)) <$> endpoints)) + _ -> searchUpToD (succ d) (Array.array (-d, d) ((\ e@(Endpoint x y _) -> (x - y, e)) <$> endpoints)) where isComplete (Endpoint x y _) = x >= n && y >= m -- Search an edit graph for the shortest edit script along a specific diagonal, moving onto a given diagonal from one of its in-bounds adjacent diagonals (if any), and sliding down any diagonal edges eagerly. searchAlongK k = slideFrom $! - if d == 0 || k < negate m || k > n then + if d == 0 || k < -m || k > n then -- The top-left corner, or otherwise out-of-bounds. Endpoint 0 0 [] - else if k == negate d || k == negate m then + else if k == -d || k == -m then -- The lower/left extent of the search region or edit graph, whichever is smaller. moveDownFrom up else if k /= d && k /= n then