Browse Source

raft: follow golint notice to replace +=1 with ++

davygeek 10 years ago
parent
commit
194607812c
2 changed files with 3 additions and 3 deletions
  1. 1 1
      raft/progress.go
  2. 2 2
      raft/raft.go

+ 1 - 1
raft/progress.go

@@ -220,7 +220,7 @@ func (in *inflights) freeTo(to uint64) {
 		}
 
 		// increase index and maybe rotate
-		if idx += 1; idx >= in.size {
+		if idx++; idx >= in.size {
 			idx -= in.size
 		}
 	}

+ 2 - 2
raft/raft.go

@@ -868,12 +868,12 @@ func (r *raft) checkQuorumActive() bool {
 
 	for id := range r.prs {
 		if id == r.id { // self is always active
-			act += 1
+			act++
 			continue
 		}
 
 		if r.prs[id].RecentActive {
-			act += 1
+			act++
 		}
 
 		r.prs[id].RecentActive = false