Skip to content

Commit 9de9a98

Browse files
authored
nit: alloc expiration_groups after declared_expirations is set (#1413)
alloc expiration_groups after declared_expirations is set
1 parent 66bb5f7 commit 9de9a98

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

actors/miner/src/expiration_queue.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,8 +777,6 @@ impl<'db, BS: Blockstore> ExpirationQueue<'db, BS> {
777777
let mut declared_expirations = BTreeMap::<ChainEpoch, bool>::new();
778778
let mut sectors_by_number = BTreeMap::<u64, &SectorOnChainInfo>::new();
779779
let mut all_remaining = BTreeSet::<u64>::new();
780-
let mut expiration_groups =
781-
Vec::<SectorExpirationSet>::with_capacity(declared_expirations.len());
782780

783781
for sector in sectors {
784782
let q_expiration = self.quant.quantize_up(sector.expiration);
@@ -787,6 +785,9 @@ impl<'db, BS: Blockstore> ExpirationQueue<'db, BS> {
787785
sectors_by_number.insert(sector.sector_number, sector);
788786
}
789787

788+
let mut expiration_groups =
789+
Vec::<SectorExpirationSet>::with_capacity(declared_expirations.len());
790+
790791
for (&expiration, _) in declared_expirations.iter() {
791792
let es = self.may_get(expiration)?;
792793

0 commit comments

Comments
 (0)