gildor
03/06/2018, 8:12 AMval foo1 = foo?.first?.second?.third?.fourth?.fifth
if (foo1 != null) {
foo1.doSomething()
} else {
otherStuff()
}
Yes, one line more, but still not sure that this much better:
if (val foo1 = foo?.first?.second?.third?.fourth?.fifth) {
foo1.doSomething()
} else {
otherStuff()
}
One line less and scoped foo1, not so bad.