perf(memory): Single-init strings for CapitalConnectionsFinder
Some checks failed
Build and test / Check code and run unit tests (push) Failing after 5m33s
Conflict marking / main (push) Failing after 4s
Detekt / detekt (ubuntu-latest) (push) Failing after 18s
Generate mkdocs from docs folder / deploy (push) Failing after 22s
Docker / build (push) Failing after 1m2s
Close stale issues and PRs / stale (push) Successful in -2s

This commit is contained in:
yairm210 2024-12-01 19:45:54 +02:00
parent ef78cd95f9
commit bda9524f2c

View File

@ -16,11 +16,13 @@ class CapitalConnectionsFinder(private val civInfo: Civilization) {
private val openBordersCivCities = civInfo.gameInfo.getCities().filter { canEnterBordersOf(it.civ) }
private val harbor = "Harbor" // hardcoding at least centralized for this class for now
private val road = RoadStatus.Road.name
private val railroad = RoadStatus.Railroad.name
private val harborFromRoad = "$harbor-$road"
private val harborFromRailroad = "$harbor-$railroad"
companion object {
private val harbor = "Harbor" // hardcoding at least centralized for this class for now
private val road = RoadStatus.Road.name
private val railroad = RoadStatus.Railroad.name
private val harborFromRoad = "$harbor-$road"
private val harborFromRailroad = "$harbor-$railroad"
}
private val ruleset = civInfo.gameInfo.ruleset
private val roadIsResearched = ruleset.tileImprovements[road].let {