Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington committed May 19, 2021
1 parent e5314c8 commit f75aea3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions runtime/src/accounts_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ pub trait ZeroLamport {
}

type MapType<T> = AccountMap<Pubkey, AccountMapEntry<T>>;
type ReadWriteLockMapType<'a, T> = RwLockWriteGuard<'a, AccountMap<Pubkey, AccountMapEntry<T>>>;
type AccountMapsWriteLock<'a, T> = RwLockWriteGuard<'a, AccountMap<Pubkey, AccountMapEntry<T>>>;

#[derive(Debug)]
pub struct AccountsIndex<T> {
Expand Down Expand Up @@ -859,10 +859,10 @@ impl<T: 'static + Clone + IsCached + ZeroLamport> AccountsIndex<T> {
pubkey: &Pubkey,
slot: Slot,
info: &T,
lock: Option<&mut ReadWriteLockMapType<T>>,
w_account_maps: Option<&mut AccountMapsWriteLock<T>>,
) -> Option<WriteAccountMapEntry<T>> {
let new_entry = WriteAccountMapEntry::new_entry_after_update(slot, info);
match lock {
match w_account_maps {
Some(w_account_maps) => {
self.insert_new_entry_if_missing_with_lock(pubkey, w_account_maps, new_entry)
}
Expand All @@ -878,7 +878,7 @@ impl<T: 'static + Clone + IsCached + ZeroLamport> AccountsIndex<T> {
fn insert_new_entry_if_missing_with_lock(
&self,
pubkey: &Pubkey,
w_account_maps: &mut ReadWriteLockMapType<T>,
w_account_maps: &mut AccountMapsWriteLock<T>,
new_entry: AccountMapEntry<T>,
) -> Option<WriteAccountMapEntry<T>> {
let mut is_newly_inserted = false;
Expand Down Expand Up @@ -1179,7 +1179,7 @@ impl<T: 'static + Clone + IsCached + ZeroLamport> AccountsIndex<T> {
}
}

pub(crate) fn get_account_maps_write_lock(&self) -> ReadWriteLockMapType<T> {
pub(crate) fn get_account_maps_write_lock(&self) -> AccountMapsWriteLock<T> {
self.account_maps.write().unwrap()
}

Expand All @@ -1193,7 +1193,7 @@ impl<T: 'static + Clone + IsCached + ZeroLamport> AccountsIndex<T> {
pubkey: &Pubkey,
account_info: T,
reclaims: &mut SlotList<T>,
w_account_maps: &mut ReadWriteLockMapType<T>,
w_account_maps: &mut AccountMapsWriteLock<T>,
) {
let account_entry =
self.insert_new_entry_if_missing(pubkey, slot, &account_info, Some(w_account_maps));
Expand Down

0 comments on commit f75aea3

Please sign in to comment.