File tree Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -45,22 +45,19 @@ const BitCountIndexByte string = "BYTE"
45
45
const BitCountIndexBit string = "BIT"
46
46
47
47
func (c cmdable ) BitCount (ctx context.Context , key string , bitCount * BitCount ) * IntCmd {
48
- args := []interface {}{"bitcount" , key }
48
+ args := make ([]any , 2 , 5 )
49
+ args [0 ] = "bitcount"
50
+ args [1 ] = key
49
51
if bitCount != nil {
50
- if bitCount .Unit == "" {
51
- bitCount .Unit = "BYTE"
52
- }
53
- if bitCount .Unit != BitCountIndexByte && bitCount .Unit != BitCountIndexBit {
54
- cmd := NewIntCmd (ctx )
55
- cmd .SetErr (errors .New ("redis: invalid bitcount index" ))
56
- return cmd
52
+ args = append (args , bitCount .Start , bitCount .End )
53
+ if bitCount .Unit != "" {
54
+ if bitCount .Unit != BitCountIndexByte && bitCount .Unit != BitCountIndexBit {
55
+ cmd := NewIntCmd (ctx )
56
+ cmd .SetErr (errors .New ("redis: invalid bitcount index" ))
57
+ return cmd
58
+ }
59
+ args = append (args , bitCount .Unit )
57
60
}
58
- args = append (
59
- args ,
60
- bitCount .Start ,
61
- bitCount .End ,
62
- string (bitCount .Unit ),
63
- )
64
61
}
65
62
cmd := NewIntCmd (ctx , args ... )
66
63
_ = c (ctx , cmd )
You can’t perform that action at this time.
0 commit comments