Yossi Saiada
05/01/2019, 11:50 AMif (y) x.getSomething() else null
Note that x.getSomething().takeIf { y }
isn't identical, because it always calculate x.getSomething()
.thana
05/01/2019, 12:11 PMwbertan
05/01/2019, 12:13 PMx.takeIf { y }?.getSomething()
🤣
But agree with @thana 👍Stephan Schroeder
05/01/2019, 12:13 PMx::getSomething.takeIf{y}?.let{it()}
damn it, William’s is simpler 😆karelpeeters
05/01/2019, 12:32 PMx
twice.