mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #13438 from lx1036/patch-2
raft: avoid jump tag to make code more understandable
This commit is contained in:
commit
3814d0800f
@ -372,14 +372,16 @@ func (n *node) run() {
|
|||||||
// very sound and likely has bugs.
|
// very sound and likely has bugs.
|
||||||
if _, okAfter := r.prs.Progress[r.id]; okBefore && !okAfter {
|
if _, okAfter := r.prs.Progress[r.id]; okBefore && !okAfter {
|
||||||
var found bool
|
var found bool
|
||||||
outer:
|
|
||||||
for _, sl := range [][]uint64{cs.Voters, cs.VotersOutgoing} {
|
for _, sl := range [][]uint64{cs.Voters, cs.VotersOutgoing} {
|
||||||
for _, id := range sl {
|
for _, id := range sl {
|
||||||
if id == r.id {
|
if id == r.id {
|
||||||
found = true
|
found = true
|
||||||
break outer
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if found {
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if !found {
|
if !found {
|
||||||
propc = nil
|
propc = nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user