From 587a043c29e42bd2932e15dd89269055e4bec383 Mon Sep 17 00:00:00 2001 From: Frank Viernau Date: Mon, 15 May 2023 14:07:12 +0200 Subject: [PATCH] refactor: Return a set from `mergeCopyrightFindings()` Returning a sorted set is no more necessary, because `ScanSummary` has been changed in a preceeding change to use a set for the copyright findings. Signed-off-by: Frank Viernau --- .../src/main/kotlin/provenance/NestedProvenanceScanResult.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scanner/src/main/kotlin/provenance/NestedProvenanceScanResult.kt b/scanner/src/main/kotlin/provenance/NestedProvenanceScanResult.kt index a892a687b38b1..f7462751c00e3 100644 --- a/scanner/src/main/kotlin/provenance/NestedProvenanceScanResult.kt +++ b/scanner/src/main/kotlin/provenance/NestedProvenanceScanResult.kt @@ -120,12 +120,12 @@ data class NestedProvenanceScanResult( return findings } - private fun Map>.mergeCopyrightFindings(): SortedSet { + private fun Map>.mergeCopyrightFindings(): Set { val findingsByPath = mapKeys { getPath(it.key) }.mapValues { (_, scanResults) -> scanResults.flatMap { it.summary.copyrightFindings } } - val findings = findingsByPath.flatMapTo(sortedSetOf()) { (path, findings) -> + val findings = findingsByPath.flatMapTo(mutableSetOf()) { (path, findings) -> val prefix = if (path.isEmpty()) path else "$path/" findings.map { it.copy(location = it.location.copy(path = "$prefix${it.location.path}")) } }