Skip to content

Commit cda6c80

Browse files
committed
refactor(spdx): Pull out a variable for later reuse
This keeps the diff smaller for an upcoming change. Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
1 parent a00c85b commit cda6c80

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

plugins/reporters/spdx/src/main/kotlin/Extensions.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ internal fun Package.toSpdxPackage(
164164
ortResult.getRepositoryLicenseChoices()
165165
)
166166

167+
val licenseDeclared = resolvedLicenseInfo.mainLicense()?.simplify()
168+
167169
return SpdxPackage(
168170
spdxId = id.toSpdxId(type),
169171
checksums = when (type) {
@@ -194,8 +196,7 @@ internal fun Package.toSpdxPackage(
194196

195197
else -> concludedLicense.nullOrBlankToSpdxNoassertionOrNone()
196198
},
197-
licenseDeclared = resolvedLicenseInfo.mainLicense()
198-
?.simplify()
199+
licenseDeclared = licenseDeclared
199200
?.sorted()
200201
?.nullOrBlankToSpdxNoassertionOrNone()
201202
?: SpdxConstants.NONE,

0 commit comments

Comments
 (0)