Back to Intellij Community

SimplifiableCallChain

plugins/kotlin/code-insight/descriptions/resources-en/inspectionDescriptions/SimplifiableCallChain.html

2025.3-rc-2350 B
Original Source

Reports two-call chains replaceable by a single call.

It can help you to avoid redundant code execution.

The quick-fix replaces the call chain with a single call.

Example:

fun main() {
      listOf(1, 2, 3).filter { it > 1 }.count()
  }

After the quick-fix is applied:

fun main() {
      listOf(1, 2, 3).count { it > 1 }
  }