Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add comments #23275

Merged
merged 1 commit into from
Feb 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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