Prechádzať zdrojové kódy

raft: remove misleading labels in array definition

Since these are arrays instead of maps, the "keys" here are actually
(useless) goto labels. What really matters is that the ordering is
the same between the constant declarations and the array.
Ben Darnell 11 rokov pred
rodič
commit
1083ce8f73
1 zmenil súbory, kde vykonal 12 pridanie a 12 odobranie
  1. 12 12
      raft/raft.go

+ 12 - 12
raft/raft.go

@@ -26,15 +26,15 @@ const (
 )
 
 var mtmap = [...]string{
-	msgHup:      "msgHup",
-	msgBeat:     "msgBeat",
-	msgProp:     "msgProp",
-	msgApp:      "msgApp",
-	msgAppResp:  "msgAppResp",
-	msgVote:     "msgVote",
-	msgVoteResp: "msgVoteResp",
-	msgSnap:     "msgSnap",
-	msgDenied:   "msgDenied",
+	"msgHup",
+	"msgBeat",
+	"msgProp",
+	"msgApp",
+	"msgAppResp",
+	"msgVote",
+	"msgVoteResp",
+	"msgSnap",
+	"msgDenied",
 }
 
 func (mt messageType) String() string {
@@ -54,9 +54,9 @@ const (
 type StateType int64
 
 var stmap = [...]string{
-	StateFollower:  "StateFollower",
-	StateCandidate: "StateCandidate",
-	StateLeader:    "StateLeader",
+	"StateFollower",
+	"StateCandidate",
+	"StateLeader",
 }
 
 func (st StateType) String() string {