From 2e31827c35c3851e99adc56fc0f9bbacd52b2b50 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Thu, 5 Dec 2024 09:12:53 +0100 Subject: [PATCH] chore(advisor): Prefer `also` over `let` when not mapping It can be confusing to use `let` if the goal is not to map the (anyway discarded) return value, so use `also` instead to emphasize that just some additional work (logging in this case) is done. Signed-off-by: Sebastian Schuberth --- advisor/src/main/kotlin/Advisor.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advisor/src/main/kotlin/Advisor.kt b/advisor/src/main/kotlin/Advisor.kt index b63a6eefdcbef..994cf9502cbcc 100644 --- a/advisor/src/main/kotlin/Advisor.kt +++ b/advisor/src/main/kotlin/Advisor.kt @@ -93,7 +93,7 @@ class Advisor( "vulnerabilities via ${provider.descriptor.displayName}. " } - providerResults.keys.takeIf { it.isNotEmpty() }?.let { pkgs -> + providerResults.keys.takeIf { it.isNotEmpty() }?.also { pkgs -> logger.debug { "Affected packages:\n\n${pkgs.joinToString("\n") { it.id.toCoordinates() }}\n" }