Skip to content

Commit

Permalink
Uses actual number of items in generate_index_for_slot() (#2919)
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo committed Sep 18, 2024
1 parent 92eca11 commit 4d999b0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8860,6 +8860,7 @@ impl AccountsDb {
}
items_local.push(info.index_info);
});
let items_len = items_local.len();
let items = items_local.into_iter().map(|info| {
if let Some(amount_to_top_off_rent_this_account) = Self::stats_for_rent_payers(
&info.pubkey,
Expand All @@ -8884,11 +8885,7 @@ impl AccountsDb {
)
});
self.accounts_index
.insert_new_if_missing_into_primary_index(
slot,
storage.approx_stored_count(),
items,
)
.insert_new_if_missing_into_primary_index(slot, items_len, items)
};
if secondary {
// scan storage a second time to update the secondary index
Expand Down

0 comments on commit 4d999b0

Please sign in to comment.