From 53b40617e222fbb71cc849ee6a36b26d8ce8ed74 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Wed, 4 Sep 2024 23:06:40 +0300 Subject: [PATCH] fixup util/xpool Signed-off-by: Vasiliy Tolstov --- util/xpool/pool.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/xpool/pool.go b/util/xpool/pool.go index cfc8d5f0..fa27df3a 100644 --- a/util/xpool/pool.go +++ b/util/xpool/pool.go @@ -27,10 +27,10 @@ func (p Pool[T]) Put(t T) { p.p.Put(t) } -func NewBytePool(size int) Pool[T] { +func NewBytePool(size int) Pool[[]byte] { return NewPool(func() []byte { return make([]byte, size) }) } -func NewBytesPool() Pool[T] { +func NewBytesPool() Pool[*bytes.Buffer] { return NewPool(func() *bytes.Buffer { return bytes.NewBuffer(nil) }) }