remove unnecessary length check

This commit is contained in:
vyzo 2020-04-22 13:37:27 +03:00
parent eccded1360
commit 32c3fb325d
1 changed files with 3 additions and 5 deletions

View File

@ -1032,11 +1032,9 @@ func (gs *GossipSubRouter) heartbeat() {
return !inMesh && !doBackoff && !direct && gs.score.Score(p) > medianScore
})
if len(plst) != 0 {
for _, p := range plst {
log.Debugf("HEARTBEAT: Opportunistically graft peer %s on topic %s", p, topic)
graftPeer(p)
}
for _, p := range plst {
log.Debugf("HEARTBEAT: Opportunistically graft peer %s on topic %s", p, topic)
graftPeer(p)
}
}
}