Skip to content

Commit 0784796

Browse files
committed
chore: Initialize configurationsById directly at the declaration
Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
1 parent d0575d3 commit 0784796

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

plugins/package-configuration-providers/api/src/main/kotlin/SimplePackageConfigurationProvider.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ open class SimplePackageConfigurationProvider(
4646
* A map that stores all package configurations by their [Identifier] for fast lookup. The version of the
4747
* [Identifier]s must be ignored because it could be a version range.
4848
*/
49-
private val configurationsById: Map<Identifier, List<PackageConfiguration>>
50-
51-
init {
52-
configurationsById = configurations.groupBy { it.id.copy(version = "") }
53-
}
49+
private val configurationsById = configurations.groupBy { it.id.copy(version = "") }
5450

5551
override fun getPackageConfigurations(packageId: Identifier, provenance: Provenance): List<PackageConfiguration> =
5652
configurationsById[packageId.copy(version = "")]?.filter { it.matches(packageId, provenance) }.orEmpty()

0 commit comments

Comments
 (0)