Reduced garbage allocation

This commit is contained in:
Anuken
2020-06-29 15:58:48 -04:00
parent d58e3ac235
commit bf5dd7386e
6 changed files with 24 additions and 22 deletions

View File

@@ -221,8 +221,7 @@ public class BlockIndexer{
}
public Building findEnemyTile(Team team, float x, float y, float range, Boolf<Building> pred){
for(Team enemy : activeTeams){
if(!team.isEnemy(enemy)) continue;
for(Team enemy : team.enemies()){
Building entity = indexer.findTile(enemy, x, y, range, pred, true);
if(entity != null){