From 2ddb28cdf8a1966780698cc17da5565da29a2274 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Wed, 23 Feb 2022 10:53:11 -0600 Subject: [PATCH] add comments (#23275) --- runtime/src/in_mem_accounts_index.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/runtime/src/in_mem_accounts_index.rs b/runtime/src/in_mem_accounts_index.rs index 70dabe3256e924..322cfbaf588739 100644 --- a/runtime/src/in_mem_accounts_index.rs +++ b/runtime/src/in_mem_accounts_index.rs @@ -433,9 +433,9 @@ impl InMemAccountsIndex { 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, new_value: (Slot, T), @@ -457,8 +457,10 @@ impl InMemAccountsIndex { 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, slot: Slot, @@ -590,8 +592,7 @@ impl InMemAccountsIndex { } } - /// 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>,