Replace `if` with elvis operator
When I write this kind of code, I always get this suggestion from the Kotlin plugin:
while (...) {
...
val something = ...
if (something == null) continue
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [Replace 'if' with elvis operator]
...
}
Is it telling me to write this?
val something = ... ?: continue
Assuming it works, isn’t it much less readable?
请先登录再写评论。