From 3ea0c27be01650d2269e1b7bfb64c8cfc1242de0 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Tue, 12 Feb 2019 22:06:26 +1100 Subject: [PATCH] Minor modification to reduce lines of code (#607) --- specs/core/0_beacon-chain.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index 0f020be53..11f5007ee 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -2030,12 +2030,10 @@ def process_penalties_and_exits(state: BeaconState) -> None: eligible_indices = filter(eligible, all_indices) # Sort in order of exit epoch, and validators that exit within the same epoch exit in order of validator index sorted_indices = sorted(eligible_indices, key=lambda index: state.validator_registry[index].exit_epoch) - withdrawn_so_far = 0 - for index in sorted_indices: - prepare_validator_for_withdrawal(state, index) - withdrawn_so_far += 1 + for withdrawn_so_far, index in enumerate(sorted_indices): if withdrawn_so_far >= MAX_WITHDRAWALS_PER_EPOCH: break + prepare_validator_for_withdrawal(state, index) ``` #### Final updates