Skip to content

Commit 4554b6e

Browse files
committed
chore(model): Simplify package association in applyPackageCurations()
Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent e7060ff commit 4554b6e

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

model/src/main/kotlin/OrtResult.kt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -699,14 +699,9 @@ internal fun applyPackageCurations(
699699
packages: Collection<Package>,
700700
curations: List<PackageCuration>
701701
): Set<CuratedPackage> {
702-
val curationsForId = packages.associateBy(
703-
keySelector = { pkg -> pkg.id },
704-
valueTransform = { pkg ->
705-
curations.filter { curation ->
706-
curation.isApplicable(pkg.id)
707-
}
708-
}
709-
)
702+
val curationsForId = packages.associate { pkg ->
703+
pkg.id to curations.filter { it.isApplicable(pkg.id) }
704+
}
710705

711706
return packages.mapTo(mutableSetOf()) { pkg ->
712707
curationsForId[pkg.id].orEmpty().asReversed().fold(pkg.toCuratedPackage()) { cur, packageCuration ->

0 commit comments

Comments
 (0)