Skip to content

Commit

Permalink
Remove redundant collect
Browse files Browse the repository at this point in the history
  • Loading branch information
someone235 committed Jan 7, 2024
1 parent 4ab7a50 commit 4325bc5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions protocol/p2p/src/core/hub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ impl Hub {
let peers = self.peers.read().values().cloned().collect::<Vec<_>>();
// TODO: At least some of the peers should be outbound, because an attacker can gain less control
// over the set of outbound peers.
let peers = peers.choose_multiple(&mut rand::thread_rng(), num_peers).cloned().collect::<Vec<_>>();

for router in peers {
for router in peers.choose_multiple(&mut rand::thread_rng(), num_peers).cloned() {
let _ = router.enqueue(msg.clone()).await;
}
}
Expand Down

0 comments on commit 4325bc5

Please sign in to comment.