From 13588123fcad794626bd06ecfcbbd748317c2245 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Tue, 22 Feb 2022 10:29:39 -0600 Subject: [PATCH] add comments --- 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 1245143fc757cb..dd72f0187c6f81 100644 --- a/runtime/src/in_mem_accounts_index.rs +++ b/runtime/src/in_mem_accounts_index.rs @@ -434,9 +434,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), @@ -458,8 +458,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, @@ -591,8 +593,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>,