Skip to content

Commit

Permalink
refactor(helper-cli): Adjust return type of getScannedProvenance()
Browse files Browse the repository at this point in the history
Simplify an upcoming change.

Signed-off-by: Frank Viernau <[email protected]>
  • Loading branch information
fviernau committed Nov 27, 2023
1 parent 4b8bf9d commit 2474f96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions helper-cli/src/main/kotlin/utils/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ internal fun OrtResult.getViolatedRulesByLicense(
/**
* Return the [Provenance] of the first scan result matching the given [id] or null if there is no match.
*/
internal fun OrtResult.getScannedProvenance(id: Identifier): Provenance? =
getScanResultsForId(id).firstOrNull()?.provenance
internal fun OrtResult.getScannedProvenance(id: Identifier): KnownProvenance? =
getScanResultsForId(id).firstNotNullOfOrNull { it.provenance as? KnownProvenance }

/**
* Return all issues from scan results. Issues for excludes [Project]s or [Package]s are not returned if and only if
Expand Down

0 comments on commit 2474f96

Please sign in to comment.