refine buffer allocation

This commit is contained in:
Darien Raymond
2018-03-11 23:06:04 +01:00
parent 5eac607087
commit f97e6fa3d2
7 changed files with 72 additions and 74 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ func (r *PacketReader) ReadMultiBuffer() (buf.MultiBuffer, error) {
if size <= buf.Size {
b = buf.New()
} else {
b = buf.NewLocal(int(size))
b = buf.NewLocal(uint32(size))
}
if err := b.AppendSupplier(buf.ReadFullFrom(r.reader, int(size))); err != nil {
b.Release()