summaryrefslogtreecommitdiff
path: root/src/diff.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/diff.hh')
-rw-r--r--src/diff.hh12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/diff.hh b/src/diff.hh
index 13f7dc40..c8063b1d 100644
--- a/src/diff.hh
+++ b/src/diff.hh
@@ -39,20 +39,14 @@ Snake find_end_snake_of_further_reaching_dpath(Iterator a, int N, Iterator b, in
const MirroredArray<int>& V,
const int D, const int k, Equal eq)
{
- int x; // our position along a
-
const bool add = k == -D or (k != D and V[k-1] < V[k+1]);
// if diagonal on the right goes further along x than diagonal on the left,
// then we take a vertical edge from it to this diagonal, hence x = V[k+1]
- if (add)
- x = V[k+1];
// else, we take an horizontal edge from our left diagonal,x = V[k-1]+1
- else
- x = V[k-1]+1;
-
- int y = x - k; // we are by construction on diagonal k, so our position along
- // b (y) is x - k.
+ const int x = add ? V[k+1] : V[k-1]+1;
+ // we are by construction on diagonal k, so our position along b (y) is x - k.
+ const int y = x - k;
int u = x, v = y;
// follow end snake along diagonal k