Skip to content

Commit

Permalink
chore(advisor): Prefer also over let when not mapping
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
sschuberth committed Dec 5, 2024
1 parent b5cc0ea commit 2e31827
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion advisor/src/main/kotlin/Advisor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down

0 comments on commit 2e31827

Please sign in to comment.