mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
try harder for to avoid scheduling dupes removal when adding changes: important use case is loading of the data from disk, it might be already sorted
This commit is contained in:
+5
-2
@@ -73,9 +73,12 @@ public class ChangeBufferingList implements Cloneable {
|
||||
}
|
||||
|
||||
private void addChange(int value) {
|
||||
if (value < 0) {
|
||||
if (!hasRemovals) hasRemovals = true;
|
||||
} else if (!mayHaveDupes && length > 0 && changes[length - 1] >= value) {
|
||||
mayHaveDupes = true;
|
||||
}
|
||||
changes[length++] = value;
|
||||
if (value < 0 && !hasRemovals) hasRemovals = true;
|
||||
if(!mayHaveDupes) mayHaveDupes = true;
|
||||
}
|
||||
|
||||
public void remove(int value) {
|
||||
|
||||
Reference in New Issue
Block a user