Reduce useless List operations (#2214)

This commit is contained in:
_tomcraft 2020-11-29 21:31:18 +01:00 committed by GitHub
parent 4555c5dbf3
commit 6882678bc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -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();
}