mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vcs-log] use Comparator.reverseOrder and Comparator.comparingInt methods
This commit is contained in:
+2
-5
@@ -25,10 +25,7 @@ import com.intellij.vcs.log.graph.utils.impl.BitSetFlags;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
import static com.intellij.vcs.log.graph.impl.permanent.DuplicateParentFixer.fixDuplicateParentCommits;
|
||||
|
||||
@@ -155,7 +152,7 @@ public class PermanentLinearGraphBuilder<CommitId> {
|
||||
|
||||
private void fixUnderdoneEdges(@NotNull NotNullFunction<CommitId, Integer> notLoadedCommitToId) {
|
||||
List<CommitId> commitIds = ContainerUtil.newArrayList(upAdjacentNodes.keySet());
|
||||
ContainerUtil.sort(commitIds, (o1, o2) -> Collections.min(upAdjacentNodes.get(o1)) - Collections.min(upAdjacentNodes.get(o2)));
|
||||
ContainerUtil.sort(commitIds, Comparator.comparingInt(o -> Collections.min(upAdjacentNodes.get(o))));
|
||||
for (CommitId notLoadCommit : commitIds) {
|
||||
int notLoadId = notLoadedCommitToId.fun(notLoadCommit);
|
||||
for (int upNodeIndex : upAdjacentNodes.get(notLoadCommit)) {
|
||||
|
||||
+1
-1
@@ -169,7 +169,7 @@ public class LinearBekController extends CascadeController {
|
||||
}
|
||||
|
||||
private SortedSet<Integer> collectNodesToCollapse(GraphNode node) {
|
||||
SortedSet<Integer> toCollapse = new TreeSet<>((o1, o2) -> o2.compareTo(o1));
|
||||
SortedSet<Integer> toCollapse = new TreeSet<>(Comparator.reverseOrder());
|
||||
for (LinearBekGraphBuilder.MergeFragment f : collectFragmentsToCollapse(node)) {
|
||||
toCollapse.add(f.getParent());
|
||||
toCollapse.addAll(f.getTailsAndBody());
|
||||
|
||||
Reference in New Issue
Block a user