From 225ec00ec466c747db22aaf9b013ad0630f565c2 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" <75863576+jeffwashington@users.noreply.github.com> Date: Thu, 6 May 2021 15:17:41 -0500 Subject: [PATCH] add comment (#17059) --- runtime/src/accounts_db.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index 20a91ec6ec..462b2a6d83 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -4947,6 +4947,9 @@ impl AccountsDb { } pub fn generate_index(&self) { + // BTreeMap because we want in-order traversal of oldest write_version to newest. + // Thus, all instances of an account in a store are added to the index in oldest to newest + // order and we update refcounts and track reclaims correctly. type AccountsMap<'a> = HashMap)>>; let mut slots = self.storage.all_slots(); #[allow(clippy::stable_sort_primitive)]