kotlin-style-guide
kotlin-style-guide copied to clipboard
Non-local returns
trafficstars
Avoid using multiple labeled returns in a lambda. Consider restructuring the lambda so that it will have a single exit point. If that's not possible or not clear enough, convert the lambda into an anonymous function.
Do not use a labeled return for the last statement in a lambda:
//Bad
CachedThreadPool.submit { return@submit 239 }