mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vcs-log] minor: use Comparator.comparing
This commit is contained in:
@@ -47,7 +47,7 @@ public class VcsLogUtil {
|
||||
@NotNull
|
||||
private static <T> Map<VirtualFile, Set<T>> groupByRoot(@NotNull Collection<T> items, @NotNull Function<T, VirtualFile> rootGetter) {
|
||||
Map<VirtualFile, Set<T>> map =
|
||||
new TreeMap<>((o1, o2) -> o1.getPresentableUrl().compareTo(o2.getPresentableUrl()));
|
||||
new TreeMap<>(Comparator.comparing(VirtualFile::getPresentableUrl));
|
||||
for (T item : items) {
|
||||
VirtualFile root = rootGetter.fun(item);
|
||||
Set<T> set = map.get(root);
|
||||
@@ -83,7 +83,7 @@ public class VcsLogUtil {
|
||||
private static Set<VirtualFile> collectRoots(@NotNull Collection<FilePath> files, @NotNull Set<VirtualFile> roots) {
|
||||
Set<VirtualFile> selectedRoots = new HashSet<>();
|
||||
|
||||
List<VirtualFile> sortedRoots = ContainerUtil.sorted(roots, (root1, root2) -> root1.getPath().compareTo(root2.getPath()));
|
||||
List<VirtualFile> sortedRoots = ContainerUtil.sorted(roots, Comparator.comparing(VirtualFile::getPath));
|
||||
|
||||
for (FilePath filePath : files) {
|
||||
VirtualFile virtualFile = filePath.getVirtualFile();
|
||||
|
||||
Reference in New Issue
Block a user