Merge pull request #5908 from gyuho/raft-cleanup

raft: remove unnecessary type-cast, else-clause
This commit is contained in:
Gyu-Ho Lee 2016-07-10 16:42:42 -07:00 committed by GitHub
commit da44e17b58

View File

@ -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])