reduce unnessary type assart (#1254)

This commit is contained in:
tyltr
2022-03-18 15:19:34 +08:00
committed by GitHub
parent 3101938850
commit 2044e1e998
2 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -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)
}
+5 -4
View File
@@ -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)