eliminate worthless work in store_accounts_to (#28365)

This commit is contained in:
Jeff Washington (jwash) 2022-10-12 13:30:20 -07:00 committed by GitHub
parent c5e59a081c
commit 53a1a14868
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 2 deletions

View File

@ -6614,12 +6614,10 @@ impl AccountsDb {
None => {
// hash any accounts where we were lazy in calculating the hash
let mut hash_time = Measure::start("hash_accounts");
let mut stats = BankHashStats::default();
let len = accounts_and_meta_to_store.len();
let mut hashes = Vec::with_capacity(len);
for index in 0..accounts.len() {
let (pubkey, account) = (accounts.pubkey(index), accounts.account(index));
stats.update(account);
let hash = Self::hash_account(slot, account, pubkey);
hashes.push(hash);
}