Skip to content

Commit 31f8ccf

Browse files
authored
Removes AccountMap type alias (#5330)
* Removes AccountMap type alias * Replaces &Arc<T> with &T
1 parent 093de80 commit 31f8ccf

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

accounts-db/src/accounts_index.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ pub type ScanResult<T> = Result<T, ScanError>;
7575
pub type SlotList<T> = Vec<(Slot, T)>;
7676
pub type SlotSlice<'s, T> = &'s [(Slot, T)];
7777
pub type RefCount = u64;
78-
pub type AccountMap<T, U> = Arc<InMemAccountsIndex<T, U>>;
7978

8079
#[derive(Default, Debug, PartialEq, Eq)]
8180
pub(crate) struct GenerateIndexResult<T: IndexValue> {
@@ -239,7 +238,7 @@ pub struct AccountsIndexRootsStats {
239238
}
240239

241240
pub struct AccountsIndexIterator<'a, T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> {
242-
account_maps: &'a [AccountMap<T, U>],
241+
account_maps: &'a [Arc<InMemAccountsIndex<T, U>>],
243242
bin_calculator: &'a PubkeyBinCalculator24,
244243
start_bound: Bound<Pubkey>,
245244
end_bound: Bound<Pubkey>,
@@ -249,7 +248,7 @@ pub struct AccountsIndexIterator<'a, T: IndexValue, U: DiskIndexValue + From<T>
249248

250249
impl<'a, T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> AccountsIndexIterator<'a, T, U> {
251250
fn range<R>(
252-
map: &AccountMap<T, U>,
251+
map: &InMemAccountsIndex<T, U>,
253252
range: R,
254253
returns_items: AccountsIndexIteratorReturnsItems,
255254
) -> Vec<(Pubkey, AccountMapEntry<T>)>
@@ -417,7 +416,7 @@ pub enum AccountsIndexScanResult {
417416
/// T: account info type to interact in in-memory items
418417
/// U: account info type to be persisted to disk
419418
pub struct AccountsIndex<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> {
420-
pub account_maps: Vec<AccountMap<T, U>>,
419+
pub account_maps: Vec<Arc<InMemAccountsIndex<T, U>>>,
421420
pub bin_calculator: PubkeyBinCalculator24,
422421
program_id_index: SecondaryIndex<RwLockSecondaryIndexEntry>,
423422
spl_token_mint_index: SecondaryIndex<RwLockSecondaryIndexEntry>,
@@ -495,11 +494,12 @@ impl<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> AccountsIndex<T, U> {
495494
}
496495
}
497496

497+
#[allow(clippy::type_complexity)]
498498
fn allocate_accounts_index(
499499
config: Option<AccountsIndexConfig>,
500500
exit: Arc<AtomicBool>,
501501
) -> (
502-
Vec<AccountMap<T, U>>,
502+
Vec<Arc<InMemAccountsIndex<T, U>>>,
503503
PubkeyBinCalculator24,
504504
AccountsIndexStorage<T, U>,
505505
) {
@@ -1423,7 +1423,7 @@ impl<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> AccountsIndex<T, U> {
14231423
);
14241424
}
14251425

1426-
pub(crate) fn get_bin(&self, pubkey: &Pubkey) -> &AccountMap<T, U> {
1426+
pub(crate) fn get_bin(&self, pubkey: &Pubkey) -> &InMemAccountsIndex<T, U> {
14271427
&self.account_maps[self.bin_calculator.bin_from_pubkey(pubkey)]
14281428
}
14291429

0 commit comments

Comments
 (0)