Skip to content

Commit

Permalink
add IsCached trait bounds to AccountsIndex (solana-labs#19584)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington authored and dankelleher committed Nov 24, 2021
1 parent 4480ea2 commit a908392
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions runtime/src/accounts_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ pub struct AccountsIndexRootsStats {
pub unrooted_cleaned_count: usize,
}

pub struct AccountsIndexIterator<'a, T> {
pub struct AccountsIndexIterator<'a, T: IsCached> {
account_maps: &'a LockMapTypeSlice<T>,
bin_calculator: &'a PubkeyBinCalculator16,
start_bound: Bound<Pubkey>,
Expand All @@ -632,7 +632,7 @@ pub struct AccountsIndexIterator<'a, T> {
collect_all_unsorted: bool,
}

impl<'a, T> AccountsIndexIterator<'a, T> {
impl<'a, T: IsCached> AccountsIndexIterator<'a, T> {
fn range<'b, R>(
map: &'b AccountMapsReadLock<'b, T>,
range: R,
Expand Down Expand Up @@ -778,7 +778,7 @@ impl ScanSlotTracker {
}

#[derive(Debug)]
pub struct AccountsIndex<T> {
pub struct AccountsIndex<T: IsCached> {
pub account_maps: LockMapType<T>,
pub bin_calculator: PubkeyBinCalculator16,
program_id_index: SecondaryIndex<DashMapSecondaryIndexEntry>,
Expand Down

0 comments on commit a908392

Please sign in to comment.