perf: stream api can be simplified here

This commit is contained in:
Breno A. 2024-06-09 10:01:03 -03:00
parent 3d00abcc91
commit 45bf5edb13
4 changed files with 5 additions and 5 deletions

View File

@ -314,6 +314,6 @@ public final class ForgingManager extends BasePlayerManager {
this.sendForgeQueueDataNotify();
// Reset changed flags.
this.player.getActiveForges().stream().forEach(forge -> forge.setChanged(false));
this.player.getActiveForges().forEach(forge -> forge.setChanged(false));
}
}

View File

@ -26,13 +26,13 @@ public class PacketCreateVehicleRsp extends BasePacket {
&& ((EntityVehicle) entity).getOwner().equals(player))
.toList();
previousVehicles.stream()
previousVehicles
.forEach(
entity -> {
List<VehicleMember> vehicleMembers =
((EntityVehicle) entity).getVehicleMembers().stream().toList();
vehicleMembers.stream()
vehicleMembers
.forEach(
vehicleMember -> player
.getScene()

View File

@ -29,7 +29,7 @@ public class PacketStoreItemDelNotify extends BasePacket {
StoreItemDelNotify.Builder proto =
StoreItemDelNotify.newBuilder().setStoreType(StoreType.STORE_TYPE_PACK);
items.stream().forEach(item -> proto.addGuidList(item.getGuid()));
items.forEach(item -> proto.addGuidList(item.getGuid()));
this.setData(proto);
}

View File

@ -264,7 +264,7 @@ public final class Language {
List<Int2ObjectMap<String>> languageMaps =
IntStream.range(0, TextStrings.NUM_LANGUAGES)
.mapToObj(mapLanguageMaps::get)
.collect(Collectors.toList());
.toList();
Map<TextStrings, TextStrings> canonicalTextStrings = new HashMap<>();
return new Int2ObjectOpenHashMap<>(