3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-03 14:50:30 +01:00

Reduce useless List operations (#2214)

Dieser Commit ist enthalten in:
_tomcraft 2020-11-29 21:31:18 +01:00 committet von GitHub
Ursprung 4555c5dbf3
Commit 6882678bc4
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -487,11 +487,8 @@ public class PacketWrapper {
* Reset the reader, so that it can be read again. * Reset the reader, so that it can be read again.
*/ */
public void resetReader() { public void resetReader() {
// Move readable objects are packet values
this.packetValues.addAll(readableObjects);
this.readableObjects.clear();
// Move all packet values to the readable for next packet. // Move all packet values to the readable for next packet.
this.readableObjects.addAll(packetValues); this.readableObjects.addAll(0, packetValues);
this.packetValues.clear(); this.packetValues.clear();
} }