cleanup: replace anonymous inner class with lambda

This commit is contained in:
P0nk
2021-04-07 23:45:16 +02:00
parent 2d143d0afd
commit 6253169e35
65 changed files with 1204 additions and 2234 deletions

View File

@@ -233,16 +233,13 @@ public class MapleStorage {
lock.lock();
try {
Collections.sort(items, new Comparator<Item>() {
@Override
public int compare(Item o1, Item o2) {
if (o1.getInventoryType().getType() < o2.getInventoryType().getType()) {
return -1;
} else if (o1.getInventoryType() == o2.getInventoryType()) {
return 0;
}
return 1;
Collections.sort(items, (o1, o2) -> {
if (o1.getInventoryType().getType() < o2.getInventoryType().getType()) {
return -1;
} else if (o1.getInventoryType() == o2.getInventoryType()) {
return 0;
}
return 1;
});
List<Item> storageItems = getItems();