From 7076dfc040e8b8484b330d69dc6c061d3e9e3aa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brais=20Gab=C3=ADn?= Date: Thu, 4 Aug 2022 16:22:28 +0200 Subject: [PATCH] Update detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/Analyzer.kt Co-authored-by: marschwar --- .../kotlin/io/gitlab/arturbosch/detekt/core/Analyzer.kt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/Analyzer.kt b/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/Analyzer.kt index 825f34b3deb3..d469dadcf86a 100644 --- a/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/Analyzer.kt +++ b/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/Analyzer.kt @@ -115,12 +115,8 @@ internal class Analyzer( val (correctableRules, otherRules) = activeRuleSetsToRuleSetConfigs .flatMap { (ruleSet, _) -> ruleSet.rules.asSequence() } - .let { sequence -> - if (bindingContext == BindingContext.EMPTY) { - sequence.filterNot { rule -> rule::class.hasAnnotation() } - } else { - sequence - } + .filter { rule -> + bindingContext != BindingContext.EMPTY || !rule::class.hasAnnotation() } .partition { isCorrectable(it) }