Skip to content

Instantly share code, notes, and snippets.

@PatilShreyas
Last active December 24, 2020 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PatilShreyas/07a03f27c0778ec426a43c8274692e0d to your computer and use it in GitHub Desktop.
Save PatilShreyas/07a03f27c0778ec426a43c8274692e0d to your computer and use it in GitHub Desktop.
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