mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-24 20:31:51 -04:00
Don't create unneeded filters in getMatchingUniquesWithNonLocalEffects - see #6695
This commit is contained in:
parent
6812caf3b3
commit
20d580976d
@ -889,9 +889,10 @@ class CityInfo {
|
||||
|
||||
|
||||
fun getMatchingUniquesWithNonLocalEffects(uniqueType: UniqueType, stateForConditionals: StateForConditionals): Sequence<Unique> {
|
||||
return cityConstructions.builtBuildingUniqueMap.getUniques(uniqueType)
|
||||
.filter { !it.isLocalEffect && it.conditionalsApply(stateForConditionals) }
|
||||
// Note that we don't query religion here, as those only have local effects
|
||||
val uniques = cityConstructions.builtBuildingUniqueMap.getUniques(uniqueType)
|
||||
// Memory performance showed that this function was very memory intensive, thus we only create the filter if needed
|
||||
return if (uniques.any()) uniques.filter { !it.isLocalEffect && it.conditionalsApply(stateForConditionals) }
|
||||
else uniques
|
||||
}
|
||||
|
||||
//endregion
|
||||
|
Loading…
x
Reference in New Issue
Block a user