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) -> {
|
Collections.sort(artists, (lhs, rhs) -> Integer.compare(rhs.getCloseness(), lhs.getCloseness()));
|
||||||
return 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()));
|
||||||
Collections.sort(albums, (lhs, rhs) -> {
|
|
||||||
return Integer.compare(rhs.getCloseness(), lhs.getCloseness());
|
|
||||||
});
|
|
||||||
Collections.sort(songs, (lhs, rhs) -> {
|
|
||||||
return Integer.compare(rhs.getCloseness(), lhs.getCloseness());
|
|
||||||
});
|
|
||||||
|
|
||||||
// Respect counts in search criteria
|
// Respect counts in search criteria
|
||||||
int artistCount = Math.min(artists.size(), criteria.getArtistCount());
|
int artistCount = Math.min(artists.size(), criteria.getArtistCount());
|
||||||
|
|
|
@ -135,9 +135,7 @@ public class CacheCleaner {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sortByAscendingModificationTime(List<File> files) {
|
private void sortByAscendingModificationTime(List<File> files) {
|
||||||
Collections.sort(files, (a, b) -> {
|
Collections.sort(files, (a, b) -> Long.compare(a.lastModified(), b.lastModified()));
|
||||||
return Long.compare(a.lastModified(), b.lastModified());
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Set<File> findUndeletableFiles() {
|
private Set<File> findUndeletableFiles() {
|
||||||
|
|
Loading…
Reference in New Issue