Skip to content

Instantly share code, notes, and snippets.

@PatilShreyas

PatilShreyas/ScopeLet.kt.diff Secret

Last active Dec 24, 2020
Embed
What would you like to do?
fun doSomething(user: User) {
- val birthDate = user.birthDate()
- val age = calculateAgeByBirthDate(birthDate)
+ val age = user.let { calculateAgeByBirthDate(it.birthDate()) }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment