Skip to content

Commit

Permalink
perf(memory): calc cheapest stat building with sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
yairm210 committed Nov 4, 2024
1 parent 69a9b5f commit 71c383b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/com/unciv/logic/city/CityConstructions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ class CityConstructions : IsPartOfGameInfoSerialization {
}

fun cheapestStatBuilding(stat: Stat): Building? {
return city.getRuleset().buildings.values
return city.getRuleset().buildings.values.asSequence()
.filter { !it.isAnyWonder() && it.isStatRelated(stat, city) &&
(it.isBuildable(this) || isBeingConstructedOrEnqueued(it.name)) }
.minByOrNull { it.cost }
Expand Down

0 comments on commit 71c383b

Please sign in to comment.