mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
diff: move method
This commit is contained in:
@@ -56,4 +56,8 @@ public class Range {
|
||||
public String toString() {
|
||||
return "[" + start1 + ", " + end1 + ") - [" + start2 + ", " + end2 + ")";
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return start1 == end1 && start2 == end2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -494,7 +494,7 @@ public class ByWord {
|
||||
|
||||
Range expand = new Range(range.start1 + startCut, range.end1 - endCut, range.start2 + startCut, range.end2 - endCut);
|
||||
|
||||
if (!isEmpty(expand)) {
|
||||
if (!expand.isEmpty()) {
|
||||
myChanges.add(expand);
|
||||
}
|
||||
}
|
||||
@@ -528,7 +528,7 @@ public class ByWord {
|
||||
for (Range range : myIterable.iterateChanges()) {
|
||||
Range trimmed = trim(myText1, myText2, range);
|
||||
|
||||
if (!isEmpty(trimmed)) {
|
||||
if (!trimmed.isEmpty()) {
|
||||
myChanges.add(trimmed);
|
||||
}
|
||||
}
|
||||
@@ -580,7 +580,7 @@ public class ByWord {
|
||||
|
||||
Range trimmed = new Range(start1, end1, start2, end2);
|
||||
|
||||
if (!isEmpty(trimmed)) {
|
||||
if (!trimmed.isEmpty()) {
|
||||
myChanges.add(trimmed);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ class LineFragmentSplitter {
|
||||
if (last1 > end1 || last2 > end2) return;
|
||||
|
||||
WordBlock block = createBlock(last1, last2, end1, end2);
|
||||
if (DiffIterableUtil.isEmpty(block.offsets)) return;
|
||||
if (block.offsets.isEmpty()) return;
|
||||
|
||||
WordBlock lastBlock = ContainerUtil.getLastItem(myResult);
|
||||
|
||||
|
||||
@@ -181,10 +181,6 @@ public class DiffIterableUtil {
|
||||
};
|
||||
}
|
||||
|
||||
public static boolean isEmpty(@NotNull Range range) {
|
||||
return range.start1 == range.end1 && range.start2 == range.end2;
|
||||
}
|
||||
|
||||
//
|
||||
// Verification
|
||||
//
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ class SubiterableDiffIterable extends ChangeDiffIterableBase {
|
||||
|
||||
myLast = new Range(Math.max(myStart1, range.start1) - myStart1, Math.min(myEnd1, range.end1) - myStart1,
|
||||
Math.max(myStart2, range.start2) - myStart2, Math.min(myEnd2, range.end2) - myStart2);
|
||||
if (!DiffIterableUtil.isEmpty(myLast)) break;
|
||||
if (!myLast.isEmpty()) break;
|
||||
myLast = null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user