Kotlin
Call chain on collection type can be simplified
Info
New
Last modified: 03 December 2024Reports 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 }
}
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
SimplifiableCallChain
Inspection Details | |
---|---|
By default bundled with: | |
Can be installed with plugin: | Kotlin, 243.23126-IJ |
Thanks for your feedback!
Was this page helpful?