From 40d95961d66049a5edd0edf03847c0c088d76d0c Mon Sep 17 00:00:00 2001 From: Frank Viernau Date: Tue, 9 Apr 2024 13:09:17 +0200 Subject: [PATCH] refactor(model): Simplify filtering resolved vulnerabilities Signed-off-by: Frank Viernau --- model/src/main/kotlin/OrtResult.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/model/src/main/kotlin/OrtResult.kt b/model/src/main/kotlin/OrtResult.kt index e6e60d5347c97..ab4a3473ddae3 100644 --- a/model/src/main/kotlin/OrtResult.kt +++ b/model/src/main/kotlin/OrtResult.kt @@ -504,12 +504,8 @@ data class OrtResult( .filterKeys { !omitExcluded || !isExcluded(it) } return if (omitResolved) { - val resolutions = getResolutions().vulnerabilities - allVulnerabilities.mapValues { (_, vulnerabilities) -> - vulnerabilities.filter { vulnerability -> - resolutions.none { it.matches(vulnerability) } - } + vulnerabilities.filter { isResolved(it) } }.filterValues { it.isNotEmpty() } } else { allVulnerabilities