IDE code-improvement suggestion
Answered
I wrote:
fun appNameToDBKey(name: String) = name.lowercase().filterNot { it.isWhitespace() }
but this is better (more succinctly and efficiently) written as
fun appNameToDBKey(name: String) = name.lowercase().filterNot(Char::isWhitespace)
Could IntelliJ detect cases like this, where a trivial function does nothing but call another function, and suggest using the called function directly?
Please sign in to leave a comment.
Nice, thanks.