Skip to content

Commit

Permalink
use previously calculated stored_size (solana-labs#757)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington authored and buffalojoec committed Apr 16, 2024
1 parent 3cde55c commit 0c2a4a7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions accounts-db/src/ancient_append_vecs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use {
accounts_hash::AccountHash,
accounts_index::{AccountsIndexScanResult, ZeroLamport},
active_stats::ActiveStatItem,
append_vec::aligned_stored_size,
storable_accounts::{StorableAccounts, StorableAccountsBySlot},
},
rand::{thread_rng, Rng},
Expand Down Expand Up @@ -822,7 +821,7 @@ impl<'a> PackedAncientStorage<'a> {
// look at each account and stop when we exceed the ideal size
while partial_inner_index_max_exclusive < alive_accounts.accounts.len() {
let account = alive_accounts.accounts[partial_inner_index_max_exclusive];
let account_size = aligned_stored_size(account.data().len());
let account_size = account.stored_size();
let new_size = bytes_total.saturating_add(account_size);
if new_size > ideal_size && bytes_total > 0 {
full = true;
Expand Down

0 comments on commit 0c2a4a7

Please sign in to comment.