Merge pull request #13438 from lx1036/patch-2

raft: avoid jump tag to make code more understandable
This commit is contained in:
Piotr Tabor 2022-01-15 17:05:22 +01:00 committed by GitHub
commit 3814d0800f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -372,14 +372,16 @@ 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
break
}
}
if found {
break
}
}
if !found {
propc = nil