Skip to content

Commit 8ba5d1d

Browse files
committedFeb 11, 2025
test(model): Avoid unnecessary temporary list creations
Signed-off-by: Frank Viernau <x9fviern@zeiss.com>
1 parent 7c8d3ec commit 8ba5d1d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎model/src/test/kotlin/licenses/TestUtils.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ import org.ossreviewtoolkit.utils.spdx.SpdxSingleLicenseExpression
2828

2929
fun containLicensesExactly(vararg licenses: String): Matcher<Iterable<ResolvedLicense>?> =
3030
neverNullMatcher { value ->
31-
val expected = licenses.map { SpdxExpression.parse(it) as SpdxSingleLicenseExpression }.toSet()
32-
val actual = value.map { it.license }.toSet()
31+
val expected = licenses.mapTo(mutableSetOf()) { SpdxExpression.parse(it) as SpdxSingleLicenseExpression }
32+
val actual = value.mapTo(mutableSetOf()) { it.license }
3333

3434
containExactly(expected).test(actual)
3535
}

0 commit comments

Comments
 (0)
Please sign in to comment.