Skip to content

Commit

Permalink
shrink_slot_forced uses a single append vec (solana-labs#29521)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington authored and gnapoli23 committed Jan 10, 2023
1 parent 08ae65d commit 6ddf6dd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions runtime/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4069,12 +4069,11 @@ impl AccountsDb {
fn shrink_slot_forced(&self, slot: Slot) -> usize {
debug!("shrink_slot_forced: slot: {}", slot);

if let Some(stores_lock) = self.storage.get_slot_stores(slot) {
let stores: SnapshotStorage = stores_lock.read().unwrap().values().cloned().collect();
if !Self::is_shrinking_productive(slot, stores.iter()) {
if let Some(store) = self.storage.get_slot_storage_entry(slot) {
if !Self::is_shrinking_productive(slot, std::iter::once(&store)) {
return 0;
}
self.do_shrink_slot_stores(slot, stores.iter())
self.do_shrink_slot_stores(slot, std::iter::once(&store))
} else {
0
}
Expand Down

0 comments on commit 6ddf6dd

Please sign in to comment.