Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

filter get_snapshot_storages for requested_slots earlier #29465

Merged
merged 2 commits into from
Jan 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions runtime/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8545,6 +8545,7 @@ impl AccountsDb {
.storage
.iter()
.map(|k| *k.key() as Slot)
.filter(|slot| requested_slots.contains(slot))
.collect::<Vec<_>>();
m.stop();
let mut m2 = Measure::start("filter");
Expand All @@ -8557,11 +8558,10 @@ impl AccountsDb {
slots
.iter()
.filter_map(|slot| {
if requested_slots.contains(slot)
&& (self.accounts_index.is_alive_root(*slot)
|| ancestors
.map(|ancestors| ancestors.contains_key(slot))
.unwrap_or_default())
if self.accounts_index.is_alive_root(*slot)
apfitzge marked this conversation as resolved.
Show resolved Hide resolved
|| ancestors
.map(|ancestors| ancestors.contains_key(slot))
.unwrap_or_default()
{
self.storage.get(slot).map_or_else(
|| None,
Expand Down