mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-150081 TimSort thinks HighlightInfoUpdaterImpl.sortByPsiElementFertility is cringe
GitOrigin-RevId: 444db6cf6a5672f3be753c4e06beb9e866fbcb72
This commit is contained in:
committed by
intellij-monorepo-bot
parent
83381aa6ac
commit
2bfe62a1fc
+10
-5
@@ -872,11 +872,16 @@ public final class HighlightInfoUpdaterImpl extends HighlightInfoUpdater impleme
|
||||
(e1, e2) -> {
|
||||
List<? extends HighlightInfo> infos1 = highlights.get(e1);
|
||||
List<? extends HighlightInfo> infos2 = highlights.get(e2);
|
||||
if ((infos1 == null) != (infos2 == null)) {
|
||||
return infos1 == null ? 1 : -1; // put fertile element first
|
||||
}
|
||||
if (infos1 == null) {
|
||||
return Integer.compare(System.identityHashCode(e1), System.identityHashCode(e2)); // for consistency
|
||||
if (infos1 == null || infos2 == null) {
|
||||
if (infos1 != null) { // put fertile element first
|
||||
return -1;
|
||||
}
|
||||
else if (infos2 != null) {
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
return Integer.compare(System.identityHashCode(e1), System.identityHashCode(e2)); // for consistency
|
||||
}
|
||||
}
|
||||
// put error-generating element first
|
||||
return maxSeverity(infos2).compareTo(maxSeverity(infos1));
|
||||
|
||||
Reference in New Issue
Block a user