mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 05:46:43 -04:00
performance: Only build strings in ruleset validation when necessary
This commit is contained in:
parent
700e24166a
commit
d62408fd31
@ -635,8 +635,8 @@ class RulesetValidator(val ruleset: Ruleset) {
|
|||||||
namedObj: INamed?,
|
namedObj: INamed?,
|
||||||
severityToReport: UniqueType.UniqueComplianceErrorSeverity
|
severityToReport: UniqueType.UniqueComplianceErrorSeverity
|
||||||
): List<RulesetError> {
|
): List<RulesetError> {
|
||||||
val prefix = (if (namedObj is IRulesetObject) "${namedObj.originRuleset}: " else "") +
|
val prefix by lazy { (if (namedObj is IRulesetObject) "${namedObj.originRuleset}: " else "") +
|
||||||
(if (namedObj == null) "The" else "${namedObj.name}'s")
|
(if (namedObj == null) "The" else "${namedObj.name}'s") }
|
||||||
if (unique.type == null) return checkUntypedUnique(unique, tryFixUnknownUniques, prefix)
|
if (unique.type == null) return checkUntypedUnique(unique, tryFixUnknownUniques, prefix)
|
||||||
|
|
||||||
val rulesetErrors = RulesetErrorList()
|
val rulesetErrors = RulesetErrorList()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user