浏览代码

Merge pull request #5908 from gyuho/raft-cleanup

raft: remove unnecessary type-cast, else-clause
Gyu-Ho Lee 9 年之前
父节点
当前提交
da44e17b58
共有 1 个文件被更改,包括 1 次插入3 次删除
  1. 1 3
      raft/raft.go

+ 1 - 3
raft/raft.go

@@ -913,11 +913,9 @@ func (r *raft) restore(s pb.Snapshot) bool {
 	r.raftLog.restore(s)
 	r.prs = make(map[uint64]*Progress)
 	for _, n := range s.Metadata.ConfState.Nodes {
-		match, next := uint64(0), uint64(r.raftLog.lastIndex())+1
+		match, next := uint64(0), r.raftLog.lastIndex()+1
 		if n == r.id {
 			match = next - 1
-		} else {
-			match = 0
 		}
 		r.setProgress(n, match, next)
 		r.logger.Infof("%x restored progress of %x [%s]", r.id, n, r.prs[n])