Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

cleanup of allocate_accounts_index #19585

Merged
merged 1 commit into from
Sep 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions runtime/src/accounts_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -830,11 +830,12 @@ impl<T: IsCached> AccountsIndex<T> {
let bins = config
.and_then(|config| config.bins)
.unwrap_or(BINS_DEFAULT);
// create bin_calculator early to verify # bins is reasonable
let bin_calculator = PubkeyBinCalculator16::new(bins);
let account_maps = (0..bins)
.into_iter()
.map(|_| RwLock::new(AccountMap::default()))
.map(|_bin| RwLock::new(AccountMap::new()))
.collect::<Vec<_>>();
let bin_calculator = PubkeyBinCalculator16::new(bins);
(account_maps, bin_calculator)
}

Expand Down