simplify isLeader() logic

This commit is contained in:
Chris Lu 2019-02-16 08:55:23 -08:00
parent 2ec6a679c2
commit ad257ae179

View file

@ -53,9 +53,6 @@ func (t *Topology) IsLeader() bool {
if t.RaftServer!=nil { if t.RaftServer!=nil {
return t.RaftServer.State() == raft.Leader return t.RaftServer.State() == raft.Leader
} }
if leader, e := t.Leader(); e == nil {
return leader == t.RaftServer.Name()
}
return false return false
} }