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.
|
* 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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue