ref: 8e301036fa5cca0e4b168d42be43022a7be03901
parent: 1cf37db07a1d3b6f56fc95e62e1c98fe5dd500c5
author: Ori Bernstein <ori@eigenstate.org>
date: Wed Oct 2 17:45:17 EDT 2024
merge3: remove unnecessary variables
--- a/sys/src/cmd/diff/merge3.c
+++ b/sys/src/cmd/diff/merge3.c
@@ -91,7 +91,7 @@
merge(Diff *l, Diff *r)
{
int lx, ly, rx, ry;
- int il, ir, x, y, δ;
+ int il, ir, δ;
Change *lc, *rc;
char *status;
vlong ln;
@@ -143,13 +143,11 @@
lc->oldy = min(lc->oldy+δ, l->len[0]);
lc->newy = min(lc->newy+δ, l->len[1]);
}
- x = lc->oldx;
- y = lc->oldy;
if(same(l, lc, r, rc)){
- fetch(l, l->ixold, ln, x-1, l->input[0], "");
+ fetch(l, l->ixold, ln, lc->oldx-1, l->input[0], "");
fetch(l, l->ixnew, lc->newx, lc->newy, l->input[1], "");
}else{
- fetch(l, l->ixold, ln, x-1, l->input[0], "");
+ fetch(l, l->ixold, ln, lc->oldx-1, l->input[0], "");
Bprint(&stdout, "<<<<<<<<<< %s\n", l->file2);
fetch(l, l->ixnew, lc->newx, lc->newy, l->input[1], "");
Bprint(&stdout, "========== original\n");
@@ -159,7 +157,7 @@
Bprint(&stdout, ">>>>>>>>>>\n");
status = "conflict";
}
- ln = y+1;
+ ln = lc->oldy+1;
il++;
ir++;
}else if(lc != nil && (rc == nil || lx < rx)){
--
⑨