Remove folds (#10128)

automerge
This commit is contained in:
Greg Fitzgerald
2020-05-19 19:13:41 -06:00
committed by GitHub
parent 439fd30840
commit d9919b99d2
7 changed files with 52 additions and 54 deletions

View File

@ -1227,12 +1227,14 @@ pub fn process_show_validators(
.current
.iter()
.chain(vote_accounts.delinquent.iter())
.fold(0, |acc, vote_account| acc + vote_account.activated_stake);
.map(|vote_account| vote_account.activated_stake)
.sum();
let total_deliquent_stake = vote_accounts
.delinquent
.iter()
.fold(0, |acc, vote_account| acc + vote_account.activated_stake);
.map(|vote_account| vote_account.activated_stake)
.sum();
let total_current_stake = total_active_stake - total_deliquent_stake;
let mut current = vote_accounts.current;