diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/TestCasesParser.kt b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/TestCasesParser.kt index 19d73cc07af..8f24b78c1b8 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/TestCasesParser.kt +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/TestCasesParser.kt @@ -54,9 +54,9 @@ fun parseTestCases(testFiles: TestFiles): SpecTestCasesSet { val matcher = testCaseInfoPattern.matcher(fileContent) var startFind = 0 - if (!testCasesSet.byFiles.contains(filename)) { - testCasesSet.byFiles[filename] = mutableMapOf() - testCasesSet.byRanges[filename] = TreeMap() + testCasesSet.byFiles.computeIfAbsent(filename) { + testCasesSet.byRanges.putIfAbsent(filename, TreeMap()) + mutableMapOf() } val testCasesOfFile = testCasesSet.byFiles[filename]!!