Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace accumulation loop with sum expressions
Make a list from the group iterator for reusage in sum expressions and to pick first group entry. The expected group sizes are very small, so performance loss by creating a temporary list should be neglectable. Alternativly, itertools.tee(group, 3) could be called to triplicate the iterator, but it was not chosen for readability reasons.
- Loading branch information