Browse Source

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 years ago
parent
commit
1083ce8f73
1 changed files with 12 additions and 12 deletions
  1. 12 12
      raft/raft.go

+ 12 - 12
raft/raft.go

@@ -26,15 +26,15 @@ const (
 )
 )
 
 
 var mtmap = [...]string{
 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 {
 func (mt messageType) String() string {
@@ -54,9 +54,9 @@ const (
 type StateType int64
 type StateType int64
 
 
 var stmap = [...]string{
 var stmap = [...]string{
-	StateFollower:  "StateFollower",
-	StateCandidate: "StateCandidate",
-	StateLeader:    "StateLeader",
+	"StateFollower",
+	"StateCandidate",
+	"StateLeader",
 }
 }
 
 
 func (st StateType) String() string {
 func (st StateType) String() string {