fixup util/xpool

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2024-09-04 23:06:40 +03:00
parent 1a9236caad
commit 097f2fcb8f

View File

@ -27,10 +27,10 @@ func (p Pool[T]) Put(t T) {
p.p.Put(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) }) 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) }) return NewPool(func() *bytes.Buffer { return bytes.NewBuffer(nil) })
} }