mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-20 21:34:46 +00:00
CommitteeCache.get_all_beacon_committees: set correct capacity to avoid realloc (#4557)
This commit is contained in:
@@ -174,7 +174,7 @@ impl CommitteeCache {
|
||||
.ok_or(Error::CommitteeCacheUninitialized(None))?;
|
||||
|
||||
initialized_epoch.slot_iter(self.slots_per_epoch).try_fold(
|
||||
Vec::with_capacity(self.slots_per_epoch as usize),
|
||||
Vec::with_capacity(self.epoch_committee_count()),
|
||||
|mut vec, slot| {
|
||||
vec.append(&mut self.get_beacon_committees_at_slot(slot)?);
|
||||
Ok(vec)
|
||||
|
||||
Reference in New Issue
Block a user