Skip to content

Commit

Permalink
reduce unnessary type assart (valyala#1254)
Browse files Browse the repository at this point in the history
  • Loading branch information
tylitianrui authored and u5surf committed Mar 23, 2022
1 parent ab56e44 commit 878c108
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion args.go
Expand Up @@ -230,7 +230,7 @@ func (a *Args) SetBytesKV(key, value []byte) {

// SetNoValue sets only 'key' as argument without the '='.
//
// Only key in argumemt, like key1&key2
// Only key in argument, like key1&key2
func (a *Args) SetNoValue(key string) {
a.args = setArg(a.args, key, "", argsNoValue)
}
Expand Down
9 changes: 5 additions & 4 deletions client.go
Expand Up @@ -2916,14 +2916,15 @@ func (c *pipelineConnClient) getClientName() []byte {

var errPipelineConnStopped = errors.New("pipeline connection has been stopped")

func acquirePipelineWork(pool *sync.Pool, timeout time.Duration) *pipelineWork {
func acquirePipelineWork(pool *sync.Pool, timeout time.Duration) (w *pipelineWork) {
v := pool.Get()
if v == nil {
v = &pipelineWork{
if v != nil {
w = v.(*pipelineWork)
} else {
w = &pipelineWork{
done: make(chan struct{}, 1),
}
}
w := v.(*pipelineWork)
if timeout > 0 {
if w.t == nil {
w.t = time.NewTimer(timeout)
Expand Down

0 comments on commit 878c108

Please sign in to comment.