refactor unwrap_or_default for type that will soon not have a default (#29257)

This commit is contained in:
Jeff Washington (jwash) 2022-12-14 17:11:36 -06:00 committed by GitHub
parent 49a136a374
commit 3a7b67ea55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -8982,11 +8982,12 @@ impl AccountsDb {
for (index, slot) in slots.iter().enumerate() { for (index, slot) in slots.iter().enumerate() {
let mut scan_time = Measure::start("scan"); let mut scan_time = Measure::start("scan");
log_status.report(index as u64); log_status.report(index as u64);
let storage_maps: SnapshotStorage = self let storage_maps = self.storage.get_slot_storage_entries(*slot);
.storage let accounts_map = storage_maps
.get_slot_storage_entries(*slot) .as_ref()
.map(|storage_maps| self.process_storage_slot(storage_maps))
.unwrap_or_default(); .unwrap_or_default();
let accounts_map = self.process_storage_slot(&storage_maps);
scan_time.stop(); scan_time.stop();
scan_time_sum += scan_time.as_us(); scan_time_sum += scan_time.as_us();
Self::update_storage_info( Self::update_storage_info(