Avoid unnecessary materialization of list

There is a realization of a `list` in the `get_unslashed_attesting_indices` helper that is unnecessary.

The functionality in this PR is the same so this change should only really be cosmetic wrt the spec.
This commit is contained in:
Alex Stokes 2019-07-10 17:00:11 -07:00 committed by GitHub
parent 1a2031989a
commit b80d6e0495
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1271,7 +1271,7 @@ def get_unslashed_attesting_indices(state: BeaconState,
output = set() # type: Set[ValidatorIndex]
for a in attestations:
output = output.union(get_attesting_indices(state, a.data, a.aggregation_bits))
return set(filter(lambda index: not state.validators[index].slashed, list(output)))
return set(filter(lambda index: not state.validators[index].slashed, output))
```
```python