Use lambda
This commit is contained in:
parent
99c03d59b3
commit
ff8862c723
|
@ -227,15 +227,9 @@ public class OfflineMusicService implements MusicService {
|
|||
}
|
||||
}
|
||||
|
||||
Collections.sort(artists, (lhs, rhs) -> {
|
||||
return Integer.compare(rhs.getCloseness(), lhs.getCloseness());
|
||||
});
|
||||
Collections.sort(albums, (lhs, rhs) -> {
|
||||
return Integer.compare(rhs.getCloseness(), lhs.getCloseness());
|
||||
});
|
||||
Collections.sort(songs, (lhs, rhs) -> {
|
||||
return Integer.compare(rhs.getCloseness(), lhs.getCloseness());
|
||||
});
|
||||
Collections.sort(artists, (lhs, rhs) -> Integer.compare(rhs.getCloseness(), lhs.getCloseness()));
|
||||
Collections.sort(albums, (lhs, rhs) -> Integer.compare(rhs.getCloseness(), lhs.getCloseness()));
|
||||
Collections.sort(songs, (lhs, rhs) -> Integer.compare(rhs.getCloseness(), lhs.getCloseness()));
|
||||
|
||||
// Respect counts in search criteria
|
||||
int artistCount = Math.min(artists.size(), criteria.getArtistCount());
|
||||
|
|
|
@ -135,9 +135,7 @@ public class CacheCleaner {
|
|||
}
|
||||
|
||||
private void sortByAscendingModificationTime(List<File> files) {
|
||||
Collections.sort(files, (a, b) -> {
|
||||
return Long.compare(a.lastModified(), b.lastModified());
|
||||
});
|
||||
Collections.sort(files, (a, b) -> Long.compare(a.lastModified(), b.lastModified()));
|
||||
}
|
||||
|
||||
private Set<File> findUndeletableFiles() {
|
||||
|
|
Loading…
Reference in New Issue