From 6ac189e6e02415ab26ccb3eaaa52c4e3d426998d Mon Sep 17 00:00:00 2001 From: Julia Beliaeva Date: Sun, 30 Oct 2016 20:10:49 +0300 Subject: [PATCH] [vcs-log] minor: lambdify, use Comparator.comparingInt --- .../log/graph/impl/facade/SimpleGraphInfo.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/SimpleGraphInfo.java b/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/SimpleGraphInfo.java index ec8f9ce678c4..fe3a20094693 100644 --- a/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/SimpleGraphInfo.java +++ b/platform/vcs-log/graph/src/com/intellij/vcs/log/graph/impl/facade/SimpleGraphInfo.java @@ -82,12 +82,9 @@ public class SimpleGraphInfo implements PermanentGraphInfo { CommitId commit = permanentCommitsInfo.getCommitId(nodeId); List parents = ContainerUtil.newSmartList(); parents.addAll(ContainerUtil.mapNotNull(asLiteLinearGraph(linearGraph).getNodes(row, LiteLinearGraph.NodeFilter.DOWN), - new Function() { - @Override - public CommitId fun(Integer row) { - if (row < start || row >= end) return null; - return permanentCommitsInfo.getCommitId(linearGraph.getNodeId(row)); - } + row1 -> { + if (row1 < start || row1 >= end) return null; + return permanentCommitsInfo.getCommitId(linearGraph.getNodeId(row1)); })); graphCommits.add(new GraphCommitImpl<>(commit, parents, permanentCommitsInfo.getTimestamp(nodeId))); commitsIdMap.add(commit); @@ -110,12 +107,7 @@ public class SimpleGraphInfo implements PermanentGraphInfo { } } - ContainerUtil.sort(headNodeIndexes, new Comparator() { - @Override - public int compare(Integer o1, Integer o2) { - return layoutIndexes[o1] - layoutIndexes[o2]; - } - }); + ContainerUtil.sort(headNodeIndexes, Comparator.comparingInt(o -> layoutIndexes[o])); int[] starts = new int[headNodeIndexes.size()]; for (int i = 0; i < starts.length; i++) { starts[i] = layoutIndexes[headNodeIndexes.get(i)];