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
@@ -128,7 +128,7 @@ func (r *AuthenticationReader) ReadMultiBuffer() (buf.MultiBuffer, error) {
if size <= buf.Size {
b = buf.New()
} else {
b = buf.NewLocal(size)
b = buf.NewLocal(uint32(size))
}
if err := b.Reset(buf.ReadFullFrom(r.reader, size)); err != nil {
b.Release()