From c396b6aaaa9537ec0f02df69c4994448c1e51b05 Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Sat, 9 Jul 2016 22:01:19 -0700 Subject: [PATCH] raft: remove unnecessary type-cast, else-clause --- raft/raft.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/raft/raft.go b/raft/raft.go index 68cf60df9..a0cc173c3 100644 --- a/raft/raft.go +++ b/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])