Skip to content

Commit 2ab2fb1

Browse files
committed
Rename variable max to maxIndex
1 parent d6c4fd7 commit 2ab2fb1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

kv/shard_router.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (s *ShardRouter) process(reqs []*pb.Request, fn func(*routerGroup, []*pb.Re
5959
}
6060

6161
var firstErr error
62-
var max uint64
62+
var maxIndex uint64
6363
for gid, rs := range grouped {
6464
g, ok := s.getGroup(gid)
6565
if !ok {
@@ -72,14 +72,14 @@ func (s *ShardRouter) process(reqs []*pb.Request, fn func(*routerGroup, []*pb.Re
7272
}
7373
continue
7474
}
75-
if r.CommitIndex > max {
76-
max = r.CommitIndex
75+
if r.CommitIndex > maxIndex {
76+
maxIndex = r.CommitIndex
7777
}
7878
}
7979
if firstErr != nil {
8080
return nil, firstErr
8181
}
82-
return &TransactionResponse{CommitIndex: max}, nil
82+
return &TransactionResponse{CommitIndex: maxIndex}, nil
8383
}
8484

8585
func (s *ShardRouter) getGroup(id uint64) (*routerGroup, bool) {

0 commit comments

Comments
 (0)