triplea-game / triplea

TripleA is a turn based strategy game and board game engine, similar to Axis & Allies or Risk.
https://triplea-game.org/
GNU General Public License v3.0
1.3k stars 387 forks source link

Clean up logic in RemoveUnitsHistoryChange. #12572

Closed asvitkine closed 2 months ago

asvitkine commented 2 months ago

Instead of many iterations and temporary objects, just use a regular for loop that makes it easier to see the flow and that should run faster due to no extra temporary objects created or multiple iterations over the same list.

Notes to Reviewer