mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-14 01:39:40 +07:00
Perf: Minor hotspot when you have many invisible-unit detectors
This commit is contained in:
@ -149,6 +149,7 @@ class CivInfoTransientCache(val civInfo: Civilization) {
|
||||
.toList() // save this, it'll be seeing a lot of use
|
||||
for (tile in unit.viewableTiles) {
|
||||
if (tile.militaryUnit == null) continue
|
||||
if (tile in newViewableInvisibleTiles) continue
|
||||
if (visibleUnitTypes.any { tile.militaryUnit!!.matchesFilter(it) })
|
||||
newViewableInvisibleTiles.add(tile)
|
||||
}
|
||||
|
@ -134,7 +134,8 @@ class TileStatFunctions(val tile: Tile) {
|
||||
// Note: Not `for ((stat, value) in other)` - that would skip zero values
|
||||
val missingStats = Stats()
|
||||
for (stat in Stat.values()) {
|
||||
if (current[stat] < minimumStats[stat]) missingStats[stat] = minimumStats[stat] - current[stat]
|
||||
if (current[stat] < minimumStats[stat])
|
||||
missingStats[stat] = minimumStats[stat] - current[stat]
|
||||
}
|
||||
return missingStats
|
||||
}
|
||||
|
Reference in New Issue
Block a user