Skip to content

Commit 2f28f18

Browse files
cxljsofekshenawa
authored andcommitted
chore: remove unused param (redis#3382)
* chore: remove unused param Signed-off-by: fukua95 <[email protected]> * chore: rename a unused param to `_` Signed-off-by: fukua95 <[email protected]> --------- Signed-off-by: fukua95 <[email protected]>
1 parent d918688 commit 2f28f18

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

internal_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,14 +364,14 @@ var _ = Describe("ClusterClient", func() {
364364
It("select slot from args for GETKEYSINSLOT command", func() {
365365
cmd := NewStringSliceCmd(ctx, "cluster", "getkeysinslot", 100, 200)
366366

367-
slot := client.cmdSlot(context.Background(), cmd)
367+
slot := client.cmdSlot(cmd)
368368
Expect(slot).To(Equal(100))
369369
})
370370

371371
It("select slot from args for COUNTKEYSINSLOT command", func() {
372372
cmd := NewStringSliceCmd(ctx, "cluster", "countkeysinslot", 100)
373373

374-
slot := client.cmdSlot(context.Background(), cmd)
374+
slot := client.cmdSlot(cmd)
375375
Expect(slot).To(Equal(100))
376376
})
377377
})

osscluster.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ func (c *ClusterClient) Process(ctx context.Context, cmd Cmder) error {
989989
}
990990

991991
func (c *ClusterClient) process(ctx context.Context, cmd Cmder) error {
992-
slot := c.cmdSlot(ctx, cmd)
992+
slot := c.cmdSlot(cmd)
993993
var node *clusterNode
994994
var moved bool
995995
var ask bool
@@ -1480,7 +1480,7 @@ func (c *ClusterClient) mapCmdsByNode(ctx context.Context, cmdsMap *cmdsMap, cmd
14801480

14811481
if c.opt.ReadOnly && c.cmdsAreReadOnly(ctx, cmds) {
14821482
for _, cmd := range cmds {
1483-
slot := c.cmdSlot(ctx, cmd)
1483+
slot := c.cmdSlot(cmd)
14841484
node, err := c.slotReadOnlyNode(state, slot)
14851485
if err != nil {
14861486
return err
@@ -1491,7 +1491,7 @@ func (c *ClusterClient) mapCmdsByNode(ctx context.Context, cmdsMap *cmdsMap, cmd
14911491
}
14921492

14931493
for _, cmd := range cmds {
1494-
slot := c.cmdSlot(ctx, cmd)
1494+
slot := c.cmdSlot(cmd)
14951495
node, err := state.slotMasterNode(slot)
14961496
if err != nil {
14971497
return err
@@ -1635,7 +1635,7 @@ func (c *ClusterClient) processTxPipeline(ctx context.Context, cmds []Cmder) err
16351635
func (c *ClusterClient) mapCmdsBySlot(ctx context.Context, cmds []Cmder) map[int][]Cmder {
16361636
cmdsMap := make(map[int][]Cmder)
16371637
for _, cmd := range cmds {
1638-
slot := c.cmdSlot(ctx, cmd)
1638+
slot := c.cmdSlot(cmd)
16391639
cmdsMap[slot] = append(cmdsMap[slot], cmd)
16401640
}
16411641
return cmdsMap
@@ -1664,7 +1664,7 @@ func (c *ClusterClient) processTxPipelineNode(
16641664
}
16651665

16661666
func (c *ClusterClient) processTxPipelineNodeConn(
1667-
ctx context.Context, node *clusterNode, cn *pool.Conn, cmds []Cmder, failedCmds *cmdsMap,
1667+
ctx context.Context, _ *clusterNode, cn *pool.Conn, cmds []Cmder, failedCmds *cmdsMap,
16681668
) error {
16691669
if err := cn.WithWriter(c.context(ctx), c.opt.WriteTimeout, func(wr *proto.Writer) error {
16701670
return writeCmds(wr, cmds)
@@ -1934,7 +1934,7 @@ func (c *ClusterClient) cmdInfo(ctx context.Context, name string) *CommandInfo {
19341934
return info
19351935
}
19361936

1937-
func (c *ClusterClient) cmdSlot(ctx context.Context, cmd Cmder) int {
1937+
func (c *ClusterClient) cmdSlot(cmd Cmder) int {
19381938
args := cmd.Args()
19391939
if args[0] == "cluster" && (args[1] == "getkeysinslot" || args[1] == "countkeysinslot") {
19401940
return args[2].(int)

0 commit comments

Comments
 (0)