Skip to content

Commit

Permalink
refactor: use buf in Args instead of bytebufferpool (#1931)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksw2000 authored Jan 2, 2025
1 parent ce283fb commit 2dfdfd8
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions args.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import (
"io"
"sort"
"sync"

"github.com/valyala/bytebufferpool"
)

const (
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 2dfdfd8

Please sign in to comment.