mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: break out of nested loop when raft id is found
Signed-off-by: Ted Yu <yuzhihong@gmail.com>
This commit is contained in:
parent
c9377195d5
commit
43794efb1f
@ -367,10 +367,12 @@ func (n *node) run() {
|
||||
// very sound and likely has bugs.
|
||||
if _, okAfter := r.prs.Progress[r.id]; okBefore && !okAfter {
|
||||
var found bool
|
||||
outer:
|
||||
for _, sl := range [][]uint64{cs.Voters, cs.VotersOutgoing} {
|
||||
for _, id := range sl {
|
||||
if id == r.id {
|
||||
found = true
|
||||
break outer
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user