Skip to content

Commit bb522cf

Browse files
committed
Small issueCommand optimisation
1 parent 432430e commit bb522cf

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/main/java/bwapi/Game.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,8 +1676,7 @@ public void setLocalSpeed(final int speed) {
16761676
public boolean issueCommand(final Collection<Unit> units, final UnitCommand command) {
16771677
return units.stream()
16781678
.map(u -> u.issueCommand(command))
1679-
.collect(Collectors.toList()) // first force all commands to be issued
1680-
.contains(true);
1679+
.reduce(false, (a, b) -> a | b);
16811680
}
16821681

16831682
/**

0 commit comments

Comments
 (0)