mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-10 04:43:29 +07:00
perf(memory): calc cheapest stat building with sequence
This commit is contained in:
parent
69a9b5ff67
commit
71c383bc6a
@ -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 }
|
||||
|
Loading…
Reference in New Issue
Block a user