Skip to content

Commit

Permalink
cleanup of allocate_accounts_index (#19585)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington authored Sep 2, 2021
1 parent 78585a9 commit 682daf1
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit 682daf1

Please sign in to comment.