mirror of https://github.com/go-redis/redis.git
refactor(gears): remove redundant nil check (#2728)
From the Go specification: "1. For a nil slice, the number of iterations is 0." [1] Therefore, an additional nil check for before the loop is unnecessary. [1]: https://go.dev/ref/spec#For_range Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
parent
dac3314bc6
commit
275af73971
|
@ -110,17 +110,13 @@ func (c cmdable) TFCallArgs(ctx context.Context, libName string, funcName string
|
||||||
lf := libName + "." + funcName
|
lf := libName + "." + funcName
|
||||||
args := []interface{}{"TFCALL", lf, numKeys}
|
args := []interface{}{"TFCALL", lf, numKeys}
|
||||||
if options != nil {
|
if options != nil {
|
||||||
if options.Keys != nil {
|
|
||||||
for _, key := range options.Keys {
|
for _, key := range options.Keys {
|
||||||
args = append(args, key)
|
args = append(args, key)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if options.Arguments != nil {
|
|
||||||
for _, key := range options.Arguments {
|
for _, key := range options.Arguments {
|
||||||
args = append(args, key)
|
args = append(args, key)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
cmd := NewCmd(ctx, args...)
|
cmd := NewCmd(ctx, args...)
|
||||||
_ = c(ctx, cmd)
|
_ = c(ctx, cmd)
|
||||||
return cmd
|
return cmd
|
||||||
|
@ -140,17 +136,13 @@ func (c cmdable) TFCallASYNCArgs(ctx context.Context, libName string, funcName s
|
||||||
lf := fmt.Sprintf("%s.%s", libName, funcName)
|
lf := fmt.Sprintf("%s.%s", libName, funcName)
|
||||||
args := []interface{}{"TFCALLASYNC", lf, numKeys}
|
args := []interface{}{"TFCALLASYNC", lf, numKeys}
|
||||||
if options != nil {
|
if options != nil {
|
||||||
if options.Keys != nil {
|
|
||||||
for _, key := range options.Keys {
|
for _, key := range options.Keys {
|
||||||
args = append(args, key)
|
args = append(args, key)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if options.Arguments != nil {
|
|
||||||
for _, key := range options.Arguments {
|
for _, key := range options.Arguments {
|
||||||
args = append(args, key)
|
args = append(args, key)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
cmd := NewCmd(ctx, args...)
|
cmd := NewCmd(ctx, args...)
|
||||||
_ = c(ctx, cmd)
|
_ = c(ctx, cmd)
|
||||||
return cmd
|
return cmd
|
||||||
|
|
Loading…
Reference in New Issue