From f77c5c5e8866bc88f462f8ce7705b28c7792bddd Mon Sep 17 00:00:00 2001 From: geemo Date: Fri, 6 Oct 2023 22:35:55 -0500 Subject: [PATCH] minor --- beacon_node/operation_pool/src/lib.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/beacon_node/operation_pool/src/lib.rs b/beacon_node/operation_pool/src/lib.rs index e4600d8671a..39327b78e6e 100644 --- a/beacon_node/operation_pool/src/lib.rs +++ b/beacon_node/operation_pool/src/lib.rs @@ -254,18 +254,14 @@ impl OperationPool { .collect(); *num_valid += aggregates.len() as i64; - // derive cliques for current attestation data - let cliques = bron_kerbosch(&aggregates, is_compatible); - // aggregate each cliques corresponding attestaiions - let mut clique_aggregates: Vec> = cliques + let mut clique_aggregates: Vec> = bron_kerbosch(&aggregates, is_compatible) .iter() .map(|clique| { - let mut res_att = aggregates[clique[0]].clone(); - for ind in clique.iter().skip(1) { - res_att.aggregate(&aggregates[*ind]); - } - res_att + clique.iter().skip(1).fold(aggregates[clique[0]].clone(), |mut acc, &ind| { + acc.aggregate(&aggregates[ind]); + acc + }) }) .collect(); let mut indices_to_remove = Vec::new();