Skip to content

Commit 2044e1e

Browse files
authored
reduce unnessary type assart (#1254)
1 parent 3101938 commit 2044e1e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

args.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ func (a *Args) SetBytesKV(key, value []byte) {
230230

231231
// SetNoValue sets only 'key' as argument without the '='.
232232
//
233-
// Only key in argumemt, like key1&key2
233+
// Only key in argument, like key1&key2
234234
func (a *Args) SetNoValue(key string) {
235235
a.args = setArg(a.args, key, "", argsNoValue)
236236
}

client.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2916,14 +2916,15 @@ func (c *pipelineConnClient) getClientName() []byte {
29162916

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

2919-
func acquirePipelineWork(pool *sync.Pool, timeout time.Duration) *pipelineWork {
2919+
func acquirePipelineWork(pool *sync.Pool, timeout time.Duration) (w *pipelineWork) {
29202920
v := pool.Get()
2921-
if v == nil {
2922-
v = &pipelineWork{
2921+
if v != nil {
2922+
w = v.(*pipelineWork)
2923+
} else {
2924+
w = &pipelineWork{
29232925
done: make(chan struct{}, 1),
29242926
}
29252927
}
2926-
w := v.(*pipelineWork)
29272928
if timeout > 0 {
29282929
if w.t == nil {
29292930
w.t = time.NewTimer(timeout)

0 commit comments

Comments
 (0)