Skip to content

Commit

Permalink
chore(spdx): Map to a set for distinct entries
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Oct 25, 2024
1 parent bdf1000 commit 357dfcd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions plugins/reporters/spdx/src/main/kotlin/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,10 @@ internal fun Package.toSpdxPackage(
licenseInfoFromFiles = if (packageVerificationCode == null) {
emptyList()
} else {
detectedLicenses.map { resolvedLicense ->
detectedLicenses.mapTo(mutableSetOf()) { resolvedLicense ->
resolvedLicense.license.takeIf { it.isValid(SpdxExpression.Strictness.ALLOW_DEPRECATED) }
.nullOrBlankToSpdxNoassertionOrNone()
}
.distinct()
.sorted()
}.sorted()
},
packageVerificationCode = packageVerificationCode,
name = id.name,
Expand Down

0 comments on commit 357dfcd

Please sign in to comment.