From 17ff138ae7160446db3abdc7c50810aaa90b894c Mon Sep 17 00:00:00 2001 From: Frank Viernau Date: Wed, 3 Jul 2024 12:56:50 +0200 Subject: [PATCH] refactor(stack): Inline a couple of variables Signed-off-by: Frank Viernau --- plugins/package-managers/stack/src/main/kotlin/Stack.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/plugins/package-managers/stack/src/main/kotlin/Stack.kt b/plugins/package-managers/stack/src/main/kotlin/Stack.kt index 13fbd9459f363..1250ed8bda58e 100644 --- a/plugins/package-managers/stack/src/main/kotlin/Stack.kt +++ b/plugins/package-managers/stack/src/main/kotlin/Stack.kt @@ -300,13 +300,10 @@ private fun parseCabalFile(cabal: String, identifierType: String): Package { url = "${getPackageUrl(id.name, id.version)}/${id.name}-${id.version}.tar.gz" ) - val vcsType = (map["source-repository-this-type"] ?: map["source-repository-head-type"]).orEmpty() - val vcsUrl = (map["source-repository-this-location"] ?: map["source-repository-head-location"]).orEmpty() - val vcsPath = (map["source-repository-this-subdir"] ?: map["source-repository-head-subdir"]).orEmpty() val vcs = VcsInfo( - type = VcsType.forName(vcsType), - url = vcsUrl, - path = vcsPath, + type = VcsType.forName((map["source-repository-this-type"] ?: map["source-repository-head-type"]).orEmpty()), + url = (map["source-repository-this-location"] ?: map["source-repository-head-location"]).orEmpty(), + path = (map["source-repository-this-subdir"] ?: map["source-repository-head-subdir"]).orEmpty(), revision = map["source-repository-this-tag"].orEmpty() )