Skip to content

Commit

Permalink
Remove 'ignore missing territories block'
Browse files Browse the repository at this point in the history
This block does not do anything.. We later check if all map
territories are in the keyset that comes from a save game. If
we have extra territories in the save game, removing them is
not going to have an effect when we check that all territories
in the map are in the save game.

IE:

The following contains check will be no different if we decrease the size
of the 'keys' set:
```
      if (!keys.contains(terr.getName())) {
```
  • Loading branch information
DanVanAtta committed Jul 24, 2020
1 parent c645e41 commit 299c68f
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -536,15 +536,7 @@ public void verify(final GameData data) {
private static void verifyKeys(
final GameData data, final Set<String> keys, final String dataTypeForErrorMessage) {
final StringBuilder errors = new StringBuilder();
final Iterator<String> iter = keys.iterator();
while (iter.hasNext()) {
final String name = iter.next();
final Territory terr = data.getMap().getTerritory(name);
// allow loading saved games with missing territories; just ignore them
if (terr == null) {
iter.remove();
}
}

for (final Territory terr : data.getMap().getTerritories()) {
if (!keys.contains(terr.getName())) {
errors
Expand Down

0 comments on commit 299c68f

Please sign in to comment.