Skip to content

Commit

Permalink
Simplifies SnapshotMinimizer::filter_storage() (solana-labs#865)
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo authored Apr 18, 2024
1 parent 033bcfc commit dd51e61
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions runtime/src/snapshot_minimizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,16 +344,10 @@ impl<'a> SnapshotMinimizer<'a> {
let aligned_total: u64 = AccountsDb::page_align(total_bytes as u64);
let mut shrink_in_progress = None;
if aligned_total > 0 {
let mut accounts = Vec::with_capacity(keep_accounts.len());

for alive_account in keep_accounts {
accounts.push(alive_account);
}

shrink_in_progress = Some(self.accounts_db().get_store_for_shrink(slot, aligned_total));
let new_storage = shrink_in_progress.as_ref().unwrap().new_storage();
self.accounts_db()
.store_accounts_frozen((slot, &accounts[..]), new_storage);
.store_accounts_frozen((slot, &keep_accounts[..]), new_storage);

new_storage.flush().unwrap();
}
Expand Down

0 comments on commit dd51e61

Please sign in to comment.