From 020c4f8ca7bf30db12410ce2871d4b251aac787e Mon Sep 17 00:00:00 2001 From: Xiang Liu Date: Sun, 24 Oct 2021 19:33:22 +0800 Subject: [PATCH] raft: avoid jump tag to make code more understandable --- raft/node.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/raft/node.go b/raft/node.go index 74376ba84..d374b6c0c 100644 --- a/raft/node.go +++ b/raft/node.go @@ -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