Skip to content

Rule: Boolean expression using in / !in for progression #3824

Answered by cortinico
Marcono1234 asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the proposal. I'm unsure if we want to start going in this direction and adding rules for missed compiler optimizations.

I would try to keep Detekt a higher level and inspect readability/code-quality issues or obvious performance problems.

IMHO for this specific rule using an IntProgression is actually way more readable than having to manually write the equivalent boolean condition.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@BraisGabin
Comment options

@Marcono1234
Comment options

@Marcono1234
Comment options

Answer selected by cortinico
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants