More variable-variable lists

This commit is contained in:
Michael Sproul
2021-11-26 13:13:46 +11:00
parent 238ac98d7c
commit 4b808d3c72
17 changed files with 91 additions and 53 deletions

View File

@@ -111,9 +111,12 @@ impl<T: BeaconChainTypes> ValidatorPubkeyCache<T> {
state: &BeaconState<T::EthSpec>,
) -> Result<(), BeaconChainError> {
if state.validators().len() > self.pubkeys.len() {
// FIXME(sproul): iter_from would be more efficient than `skip` here
self.import(
state.validators()[self.pubkeys.len()..]
state
.validators()
.iter()
.skip(self.pubkeys.len())
.map(|v| v.pubkey),
)
} else {