rook
05/24/2017, 5:08 PMremote.foo != null && remote.foo != local.foo I’m trying to simplify it to something like remote.foo != local.foo ?: false but it seems like the elvis operator can’t be used that waykingsley
05/24/2017, 5:40 PMremote?.foo != local.fookingsley
05/24/2017, 5:43 PMremote?.let { it.foo != local.foo } ?: falserook
05/24/2017, 5:43 PMlocal and remote are non-null, but in either case foo is nullable. I need the entire check to default to false if remote.foo is null without having the entire separate clause to check itrook
05/24/2017, 5:44 PMlet, but it ends up being about the same amount of characters 😓kingsley
05/24/2017, 5:52 PMkingsley
05/24/2017, 5:54 PMfun checkFoo(remote: Bar, local: Bar) : Boolean {
val remoteFoo = remote.foo ?: return false
return remoteFoo != local.foo
}rook
05/25/2017, 1:25 PM