diff3: Simplify startmark calculation in Ascript

Remove redundant calculation for startmark.

Sponsored by:	Klara, Inc.
This commit is contained in:
Tom Jones 2022-08-02 14:23:10 +01:00
parent 426afc8f52
commit 264a559ac8

View File

@ -638,14 +638,13 @@ Ascript(int n)
old = &de[n].old;
deletenew = (new->from == new->to);
deleteold = (old->from == old->to);
startmark = old->from + (old->to - old->from) - 1;
if (de[n].type == DIFF_TYPE2) {
if (!oflag || !overlap[n]) {
prange(old, deletenew);
printrange(fp[2], new);
} else {
startmark = new->from + (new->to - new->from);
startmark = new->to;
if (!deletenew)
startmark--;
@ -664,6 +663,8 @@ Ascript(int n)
}
} else if (de[n].type == DIFF_TYPE3) {
startmark = old->to - 1;
if (!oflag || !overlap[n]) {
prange(old, deletenew);
printrange(fp[2], new);