diff3: Simplify startmark calculation in Ascript
Remove redundant calculation for startmark. Sponsored by: Klara, Inc.
This commit is contained in:
parent
426afc8f52
commit
264a559ac8
@ -638,14 +638,13 @@ Ascript(int n)
|
|||||||
old = &de[n].old;
|
old = &de[n].old;
|
||||||
deletenew = (new->from == new->to);
|
deletenew = (new->from == new->to);
|
||||||
deleteold = (old->from == old->to);
|
deleteold = (old->from == old->to);
|
||||||
startmark = old->from + (old->to - old->from) - 1;
|
|
||||||
|
|
||||||
if (de[n].type == DIFF_TYPE2) {
|
if (de[n].type == DIFF_TYPE2) {
|
||||||
if (!oflag || !overlap[n]) {
|
if (!oflag || !overlap[n]) {
|
||||||
prange(old, deletenew);
|
prange(old, deletenew);
|
||||||
printrange(fp[2], new);
|
printrange(fp[2], new);
|
||||||
} else {
|
} else {
|
||||||
startmark = new->from + (new->to - new->from);
|
startmark = new->to;
|
||||||
|
|
||||||
if (!deletenew)
|
if (!deletenew)
|
||||||
startmark--;
|
startmark--;
|
||||||
@ -664,6 +663,8 @@ Ascript(int n)
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else if (de[n].type == DIFF_TYPE3) {
|
} else if (de[n].type == DIFF_TYPE3) {
|
||||||
|
startmark = old->to - 1;
|
||||||
|
|
||||||
if (!oflag || !overlap[n]) {
|
if (!oflag || !overlap[n]) {
|
||||||
prange(old, deletenew);
|
prange(old, deletenew);
|
||||||
printrange(fp[2], new);
|
printrange(fp[2], new);
|
||||||
|
Loading…
Reference in New Issue
Block a user