Use lambda style comparators where possible. They are easier to read.
Change-Id: I5b80cfcd90909c94286742fa83af71015532809f
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
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) {