Use a lambda expression to simplify the sorting in WUDPartitionHeader

This commit is contained in:
Maschell 2019-04-10 17:59:02 +02:00
parent d713a3d735
commit de322b9ebc

View File

@ -72,12 +72,7 @@ public final class WUDPartitionHeader {
// We have to make sure, that the list is ordered by index // We have to make sure, that the list is ordered by index
List<Content> contents = new ArrayList<>(allContents.values()); List<Content> contents = new ArrayList<>(allContents.values());
Collections.sort(contents, new Comparator<Content>() { Collections.sort(contents, (o1, o2) -> Short.compare(o1.getIndex(), o2.getIndex()));
@Override
public int compare(Content o1, Content o2) {
return Short.compare(o1.getIndex(), o2.getIndex());
}
});
for (Content c : allContents.values()) { for (Content c : allContents.values()) {
if (!c.isHashed() || !c.isEncrypted()) { if (!c.isHashed() || !c.isEncrypted()) {