mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2025-02-02 04:41:32 +01:00
Reduce useless List operations (#2214)
This commit is contained in:
parent
4555c5dbf3
commit
6882678bc4
@ -487,11 +487,8 @@ public class PacketWrapper {
|
||||
* Reset the reader, so that it can be read again.
|
||||
*/
|
||||
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.
|
||||
this.readableObjects.addAll(packetValues);
|
||||
this.readableObjects.addAll(0, packetValues);
|
||||
this.packetValues.clear();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user