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"
4545const BitCountIndexBit string = "BIT"
4646
4747func (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
4951 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 )
5760 }
58- args = append (
59- args ,
60- bitCount .Start ,
61- bitCount .End ,
62- string (bitCount .Unit ),
63- )
6461 }
6562 cmd := NewIntCmd (ctx , args ... )
6663 _ = c (ctx , cmd )
You can’t perform that action at this time.
0 commit comments