Skip to content

Commit 0dfff19

Browse files
committed
Removing an unused variable
1 parent 026d036 commit 0dfff19

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

pool.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -604,11 +604,10 @@ func (p *Pool) MExpire(ctx context.Context, expiration time.Duration, keys ...st
604604
var wg sync.WaitGroup
605605
var mu sync.Mutex
606606
var results []redis.Cmder
607-
var i int
608607
for ind, keys := range index2Keys {
609608
wg.Add(1)
610609
conn, _ := factory.shards[ind].getMasterConn()
611-
go func(i int, conn *redis.Client, keys ...string) {
610+
go func(conn *redis.Client, keys ...string) {
612611
pipe := conn.Pipeline()
613612
for _, key := range keys {
614613
pipe.Expire(ctx, key, expiration)
@@ -623,8 +622,7 @@ func (p *Pool) MExpire(ctx context.Context, expiration time.Duration, keys ...st
623622
mu.Unlock()
624623
}
625624
wg.Done()
626-
}(i, conn, keys...)
627-
i++
625+
}(conn, keys...)
628626
}
629627
wg.Wait()
630628

@@ -689,11 +687,10 @@ func (p *Pool) MExpireAt(ctx context.Context, tm time.Time, keys ...string) map[
689687
var wg sync.WaitGroup
690688
var mu sync.Mutex
691689
var results []redis.Cmder
692-
var i int
693690
for ind, keys := range index2Keys {
694691
wg.Add(1)
695692
conn, _ := factory.shards[ind].getMasterConn()
696-
go func(i int, conn *redis.Client, keys ...string) {
693+
go func(conn *redis.Client, keys ...string) {
697694
pipe := conn.Pipeline()
698695
for _, key := range keys {
699696
pipe.ExpireAt(ctx, key, tm)
@@ -708,8 +705,7 @@ func (p *Pool) MExpireAt(ctx context.Context, tm time.Time, keys ...string) map[
708705
mu.Unlock()
709706
}
710707
wg.Done()
711-
}(i, conn, keys...)
712-
i++
708+
}(conn, keys...)
713709
}
714710
wg.Wait()
715711

0 commit comments

Comments
 (0)