Skip to content

Commit

Permalink
Use a stream instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
asvitkine committed Jul 10, 2023
1 parent d543cd5 commit ee99fbc
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ private void checkLists(final List<Tuple<String, List<Rule>>> ruleLists) {
}
}
if (!rulesCopy.isEmpty()) {
String missing = "";
for (Rule rule : rulesCopy) {
missing += rule.getProductionRule().getName() + ", ";
}
final String missing =
rulesCopy.stream()
.map(rule -> rule.getProductionRule().getName())
.collect(Collectors.joining(", "));
throw new IllegalStateException(
"production_tabs: must include all player production rules/units; missing: " + missing);
}
Expand Down

0 comments on commit ee99fbc

Please sign in to comment.