Skip to content

Commit

Permalink
Simplify hasAnnotation check
Browse files Browse the repository at this point in the history
  • Loading branch information
matejdro committed Jan 16, 2024
1 parent 25dbaba commit 3d16e57
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ class TooManyFunctions(config: Config) : Rule(
ignoreDeprecated && function.hasAnnotation(DEPRECATED) -> true
ignorePrivate && function.isPrivate() -> true
ignoreOverridden && function.isOverride() -> true
ignoreAnnotatedFunctions.any { function.hasAnnotation(it) } -> true
else -> false
else -> function.hasAnnotation(*ignoreAnnotatedFunctions.toTypedArray())

Check failure

Code scanning / detekt

In most cases using a spread operator causes a full copy of the array to be created before calling a method. This may result in a performance penalty. Error

Used in this way a spread operator causes a full copy of the array to be created before calling a method. This may result in a performance penalty.
}

companion object {
Expand Down

0 comments on commit 3d16e57

Please sign in to comment.