Also use lambda for sorting

This commit is contained in:
AndyScherzinger 2018-06-06 14:33:05 +02:00
parent 51eab2457d
commit 379c461f33
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -47,12 +47,9 @@ public class FileSortOrderByDate extends FileSortOrder {
public List<OCFile> sortCloudFiles(List<OCFile> files) { public List<OCFile> sortCloudFiles(List<OCFile> files) {
final int multiplier = mAscending ? 1 : -1; final int multiplier = mAscending ? 1 : -1;
Collections.sort(files, new Comparator<OCFile>() { Collections.sort(files, (o1, o2) -> {
@SuppressFBWarnings(value = "Bx", justification = "Would require stepping up API level")
public int compare(OCFile o1, OCFile o2) {
Long obj1 = o1.getModificationTimestamp(); Long obj1 = o1.getModificationTimestamp();
return multiplier * obj1.compareTo(o2.getModificationTimestamp()); return multiplier * obj1.compareTo(o2.getModificationTimestamp());
}
}); });
return super.sortCloudFiles(files); return super.sortCloudFiles(files);