Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Remove redundant vec
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiEres committed Jun 15, 2023
1 parent 375230c commit de9e834
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions node/network/bridge/src/tx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,8 @@ where
network_service.report_peer(peer, rep);
},
NetworkBridgeTxMessage::ReportPeer(ReportPeerMessage::Batch(batch)) => {
let reports: Vec<(PeerId, ReputationChange)> = batch
.iter()
.map(|(&peer, &score)| {
(peer, ReputationChange::new(score, "Aggregated reputation change"))
})
.collect();

for (peer, rep) in reports {
for (peer, score) in batch {
let rep = ReputationChange::new(score, "Aggregated reputation change");
if !rep.value.is_positive() {
gum::debug!(target: LOG_TARGET, ?peer, ?rep, action = "ReportPeer");
}
Expand Down

0 comments on commit de9e834

Please sign in to comment.