fn insert_new_entry_if_missing_with_lock(
        &self,
        pubkey: &Pubkey,
        w_account_maps: &mut AccountMapsWriteLock<T>,
        new_entry: AccountMapEntry<T>,
    ) -> Option<WriteAccountMapEntry<T>> {
        let mut is_newly_inserted = false;
        let account_entry = w_account_maps.entry(*pubkey).or_insert_with(|| {
            is_newly_inserted = true;
            new_entry
        });
        if is_newly_inserted {
            None
        } else {
            Some(WriteAccountMapEntry::from_account_map_entry(
                account_entry.clone(),
            ))
        }
    }
// return None if item was created new
// if entry for pubkey already existed, return Some(entry). Caller needs to call entry.update.
return None if item was created new
if entry for pubkey already existed, return Some(entry). Caller needs to call entry.update.
return None if item was created new if entry for pubkey already existed return Some ( entry ) . Caller needs to call entry . update .
fn insert_new_entry_if_missing_with_lock(
        &self,
        pubkey: &Pubkey,
        w_account_maps: &mut AccountMapsWriteLock<T>,
        new_entry: AccountMapEntry<T>,
    ) -> Option<WriteAccountMapEntry<T>> {
        let mut is_newly_inserted = false;
        let account_entry = w_account_maps.entry(*pubkey).or_insert_with(|| {
            is_newly_inserted = true;
            new_entry
        });
        if is_newly_inserted {
            None
        } else {
            Some(WriteAccountMapEntry::from_account_map_entry(
                account_entry.clone(),
            ))
        }
    }
fn insert_new_entry_if_missing_with_lock ( & self , pubkey : & Pubkey , w_account_maps : & mut AccountMapsWriteLock < T > , new_entry : AccountMapEntry < T > , ) -> Option < WriteAccountMapEntry < T > > { let mut is_newly_inserted = false ; let account_entry = w_account_maps . entry ( * pubkey ) . or_insert_with ( | | { is_newly_inserted = true ; new_entry } ) ; if is_newly_inserted { None } else { Some ( WriteAccountMapEntry :: from_account_map_entry ( account_entry . clone ( ) , ) ) } }
return None if item was created new
if entry for pubkey already existed, return Some(entry).
return None if item was created new if entry for pubkey already existed return Some ( entry ) .
&self
pubkey
&Pubkey
w_account_maps
&mut AccountMapsWriteLock<T>
new_entry
AccountMapEntry<T>
&self
pubkey
&Pubkey
w_account_maps
&mut AccountMapsWriteLock<T>
new_entry
AccountMapEntry<T>