Browse Source

raft: simplify boolean comparison, remove unused

Gyu-Ho Lee 9 years ago
parent
commit
0c5d1d5641
2 changed files with 1 additions and 11 deletions
  1. 0 10
      raft/raft_test.go
  2. 1 1
      raft/rawnode_test.go

+ 0 - 10
raft/raft_test.go

@@ -1321,10 +1321,6 @@ func TestRecvMsgVote(t *testing.T) {
 	testRecvMsgVote(t, pb.MsgVote)
 }
 
-func testRecvMsgPreVote(t *testing.T) {
-	testRecvMsgVote(t, pb.MsgPreVote)
-}
-
 func testRecvMsgVote(t *testing.T, msgType pb.MessageType) {
 	tests := []struct {
 		state   StateType
@@ -2925,12 +2921,6 @@ func TestTransferNonMember(t *testing.T) {
 	}
 }
 
-// ents creates a raft state machine with a sequence of log entries at
-// the given terms.
-func ents(terms ...uint64) *raft {
-	return entsWithConfig(nil, terms...)
-}
-
 func entsWithConfig(configFunc func(*Config), terms ...uint64) *raft {
 	storage := NewMemoryStorage()
 	for i, term := range terms {

+ 1 - 1
raft/rawnode_test.go

@@ -128,7 +128,7 @@ func TestRawNodeReadIndex(t *testing.T) {
 	rawNode.raft.readStates = wrs
 	// ensure the ReadStates can be read out
 	hasReady := rawNode.HasReady()
-	if hasReady != true {
+	if !hasReady {
 		t.Errorf("HasReady() returns %t, want %t", hasReady, true)
 	}
 	rd := rawNode.Ready()