pull append_vec_id() out of loop (#20713)

This commit is contained in:
Jeff Washington (jwash)
2021-10-15 10:41:23 -05:00
committed by GitHub
parent 00b9056004
commit 1e064c32e2

View File

@ -2509,10 +2509,11 @@ impl AccountsDb {
for store in stores { for store in stores {
let mut start = 0; let mut start = 0;
original_bytes += store.total_bytes(); original_bytes += store.total_bytes();
let store_id = store.append_vec_id();
while let Some((account, next)) = store.accounts.get_account(start) { while let Some((account, next)) = store.accounts.get_account(start) {
let new_entry = FoundStoredAccount { let new_entry = FoundStoredAccount {
account, account,
store_id: store.append_vec_id(), store_id,
account_size: next - start, account_size: next - start,
}; };
match stored_accounts.entry(new_entry.account.meta.pubkey) { match stored_accounts.entry(new_entry.account.meta.pubkey) {