You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Core: Replace generator creation/iteration in CollectionState methods (#4587)
* Core: Replace generator creation/iteration in CollectionState methods
Using generators in these functions incurs overhead to create the new
generator instance, call the `any`/`all`/`sum` function and have the
`any`/`all`/`sum` function iterate the generator, which in turn iterates
the iterable.
Replacing the use of generators with for loops is faster.
Getting `self.prog_items[player]` once in advance also improves
performance of iterating longer iterables.
* Add comment on the choice of for loops instead of any()/all()/sum()
0 commit comments