mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-04 23:23:20 +08:00
perf: stream api can be simplified here
This commit is contained in:
parent
3d00abcc91
commit
45bf5edb13
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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()
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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<>(
|
||||
|
Loading…
Reference in New Issue
Block a user