From 41b450b11c5930179016ba1a54d77e03f0c70b4c Mon Sep 17 00:00:00 2001 From: Frank Viernau Date: Fri, 24 May 2024 18:20:38 +0200 Subject: [PATCH] refactor: Remove some unnecessary uses of sorted sets Signed-off-by: Frank Viernau --- model/src/main/kotlin/licenses/LicenseClassifications.kt | 2 +- model/src/test/kotlin/DependencyTreeNavigatorTest.kt | 2 +- model/src/test/kotlin/licenses/LicenseInfoResolverTest.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/model/src/main/kotlin/licenses/LicenseClassifications.kt b/model/src/main/kotlin/licenses/LicenseClassifications.kt index 78a0d366717be..a4825cd7680d3 100644 --- a/model/src/main/kotlin/licenses/LicenseClassifications.kt +++ b/model/src/main/kotlin/licenses/LicenseClassifications.kt @@ -70,7 +70,7 @@ data class LicenseClassifications( /** A property allowing convenient access to the names of all categories defined in alphabetical order. */ @get:JsonIgnore val categoryNames: Set by lazy { - categories.mapTo(sortedSetOf()) { it.name } + categories.mapTo(mutableSetOf()) { it.name } } init { diff --git a/model/src/test/kotlin/DependencyTreeNavigatorTest.kt b/model/src/test/kotlin/DependencyTreeNavigatorTest.kt index 84e5e1cbc4b30..a294b41ceb1cd 100644 --- a/model/src/test/kotlin/DependencyTreeNavigatorTest.kt +++ b/model/src/test/kotlin/DependencyTreeNavigatorTest.kt @@ -82,7 +82,7 @@ class DependencyTreeNavigatorTest : AbstractDependencyNavigatorTest() { "dependencyTreeDepth" should { "return 0 if the scope does not contain any package" { - val scope = Scope(name = "test", dependencies = sortedSetOf()) + val scope = Scope(name = "test", dependencies = emptySet()) val project = Project.EMPTY.copy(scopeDependencies = setOf(scope)) navigator.dependencyTreeDepth(project, scope.name) shouldBe 0 diff --git a/model/src/test/kotlin/licenses/LicenseInfoResolverTest.kt b/model/src/test/kotlin/licenses/LicenseInfoResolverTest.kt index 26cf86c13c057..04f80eed93af6 100644 --- a/model/src/test/kotlin/licenses/LicenseInfoResolverTest.kt +++ b/model/src/test/kotlin/licenses/LicenseInfoResolverTest.kt @@ -662,7 +662,7 @@ private fun createResolver( archiver: FileArchiver = FileArchiver.createDefault() ) = LicenseInfoResolver( provider = SimpleLicenseInfoProvider(data), - copyrightGarbage = CopyrightGarbage(copyrightGarbage.toSortedSet()), + copyrightGarbage = CopyrightGarbage(copyrightGarbage), addAuthorsToCopyrights = addAuthorsToCopyrights, archiver = archiver )