cleanup of allocate_accounts_index (#19585)
This commit is contained in:
parent
78585a992b
commit
682daf1117
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue