diff --git a/protocol/src/main/java/com/zfoo/protocol/buffer/ByteBufUtils.java b/protocol/src/main/java/com/zfoo/protocol/buffer/ByteBufUtils.java index 5e999f13..81c9c6d5 100644 --- a/protocol/src/main/java/com/zfoo/protocol/buffer/ByteBufUtils.java +++ b/protocol/src/main/java/com/zfoo/protocol/buffer/ByteBufUtils.java @@ -417,7 +417,7 @@ public abstract class ByteBufUtils { public static List readPacketList(ByteBuf byteBuf, IProtocolRegistration protocolRegistration) { var length = readInt(byteBuf); - var list = new ArrayList(CollectionUtils.comfortableLength(length)); + List list = CollectionUtils.newList(length); for (var i = 0; i < length; i++) { list.add((IPacket) protocolRegistration.read(byteBuf)); } @@ -1269,7 +1269,7 @@ public abstract class ByteBufUtils { public static List readStringList(ByteBuf byteBuf) { var length = readInt(byteBuf); - var list = new ArrayList(CollectionUtils.comfortableLength(length)); + List list = CollectionUtils.newList(length); for (var i = 0; i < length; i++) { list.add(readString(byteBuf)); }