Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington committed Feb 22, 2022
1 parent 8b32e80 commit 1358812
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions runtime/src/in_mem_accounts_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,9 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
Self::update_stat(count, 1);
}

// Try to update an item in the slot list the given `slot` If an item for the slot
// already exists in the list, remove the older item, add it to `reclaims`, and insert
// the new item.
/// Try to update an item in the slot list the given `slot` If an item for the slot
/// already exists in the list, remove the older item, add it to `reclaims`, and insert
/// the new item.
pub fn lock_and_update_slot_list(
current: &AccountMapEntryInner<T>,
new_value: (Slot, T),
Expand All @@ -458,8 +458,10 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
current.set_dirty(true);
}

// modifies slot_list
// returns true if caller should addref
/// modifies slot_list
/// any entry at 'slot' is replaced with 'account_info'.
/// or, 'account_info' is appended to the slot list if the slot did not exist previously.
/// returns true if caller should addref
fn update_slot_list(
list: &mut SlotList<T>,
slot: Slot,
Expand Down Expand Up @@ -591,8 +593,7 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
}
}

/// return tuple:
/// true if item already existed in the index
/// return true if item already existed in the index
fn upsert_on_disk(
&self,
vacant: VacantEntry<K, AccountMapEntry<T>>,
Expand Down

0 comments on commit 1358812

Please sign in to comment.