diff options
author | Michael Keppler <Michael.Keppler@gmx.de> | 2019-11-17 18:07:09 +0100 |
---|---|---|
committer | Michael Keppler <Michael.Keppler@gmx.de> | 2019-11-17 18:07:09 +0100 |
commit | f8e60ce1cf1b1241c6d44f5dd84c204784157642 (patch) | |
tree | 014cac12a60ce044a469d6eb40fd5849be0e4c95 | |
parent | 8fcba48b72f632c68bab9868bec3b52b4588b7ce (diff) | |
download | jgit-f8e60ce1cf1b1241c6d44f5dd84c204784157642.tar.gz jgit-f8e60ce1cf1b1241c6d44f5dd84c204784157642.zip |
Simplify comparator code
Use lambda style comparators where possible. They are easier to read.
Change-Id: I5b80cfcd90909c94286742fa83af71015532809f
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackedBatchRefUpdate.java | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackedBatchRefUpdate.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackedBatchRefUpdate.java index e45b53ea68..9023570607 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackedBatchRefUpdate.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackedBatchRefUpdate.java @@ -366,12 +366,8 @@ class PackedBatchRefUpdate extends BatchRefUpdate { List<ReceiveCommand> commands) throws IOException { // Construct a new RefList by merging the old list with the updates. // This assumes that each ref occurs at most once as a ReceiveCommand. - Collections.sort(commands, new Comparator<ReceiveCommand>() { - @Override - public int compare(ReceiveCommand a, ReceiveCommand b) { - return a.getRefName().compareTo(b.getRefName()); - } - }); + Collections.sort(commands, + Comparator.comparing(ReceiveCommand::getRefName)); int delta = 0; for (ReceiveCommand c : commands) { |