Pattern: Use of spread operator
Issue: -
Using a spread operator causes a full copy of the array to be created before calling a method. This has a very high performance penalty.
Example of incorrect code:
fun foo(strs: Array<String>) {
bar(*strs)
}
fun bar(vararg strs: String) {
strs.forEach { println(it) }
}