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) }