From 2dfdfd86bf959e1b9f931658834cd04e2b9c0cd3 Mon Sep 17 00:00:00 2001 From: Kashiwa <13825170+ksw2000@users.noreply.github.com> Date: Fri, 3 Jan 2025 07:05:43 +0800 Subject: [PATCH] refactor: use buf in Args instead of bytebufferpool (#1931) --- args.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/args.go b/args.go index c4f6904895..dde4c0ba39 100644 --- a/args.go +++ b/args.go @@ -6,8 +6,6 @@ import ( "io" "sort" "sync" - - "github.com/valyala/bytebufferpool" ) const ( @@ -295,10 +293,8 @@ func (a *Args) GetUint(key string) (int, error) { // SetUint sets uint value for the given key. func (a *Args) SetUint(key string, value int) { - bb := bytebufferpool.Get() - bb.B = AppendUint(bb.B[:0], value) - a.SetBytesV(key, bb.B) - bytebufferpool.Put(bb) + a.buf = AppendUint(a.buf[:0], value) + a.SetBytesV(key, a.buf) } // SetUintBytes sets uint value for the given key.