move invariant code outside loop (#32837)
This commit is contained in:
parent
13b7ae1432
commit
9260c0f645
|
@ -7205,6 +7205,15 @@ impl AccountsDb {
|
|||
);
|
||||
let splitter = SplitAncientStorages::new(oldest_non_ancient_slot, snapshot_storages);
|
||||
|
||||
let slots_per_epoch = config
|
||||
.rent_collector
|
||||
.epoch_schedule
|
||||
.get_slots_in_epoch(config.rent_collector.epoch);
|
||||
let one_epoch_old = snapshot_storages
|
||||
.range()
|
||||
.end
|
||||
.saturating_sub(slots_per_epoch);
|
||||
|
||||
stats.scan_chunks = splitter.chunk_count;
|
||||
(0..splitter.chunk_count)
|
||||
.into_par_iter()
|
||||
|
@ -7213,15 +7222,6 @@ impl AccountsDb {
|
|||
|
||||
let range_this_chunk = splitter.get_slot_range(chunk)?;
|
||||
|
||||
let slots_per_epoch = config
|
||||
.rent_collector
|
||||
.epoch_schedule
|
||||
.get_slots_in_epoch(config.rent_collector.epoch);
|
||||
let one_epoch_old = snapshot_storages
|
||||
.range()
|
||||
.end
|
||||
.saturating_sub(slots_per_epoch);
|
||||
|
||||
let file_name = {
|
||||
let mut load_from_cache = true;
|
||||
let mut hasher = hash_map::DefaultHasher::new();
|
||||
|
|
Loading…
Reference in New Issue