adam-mcneilly
12/21/2016, 4:48 PMString passed = isSuccess ? "Passed" : "Failed";
Ruckus
12/21/2016, 4:49 PMString passed = if (isSuccess) "Passed" else "Failed";
adam-mcneilly
12/21/2016, 4:49 PMkenneth_ford
12/21/2016, 4:49 PMRuckus
12/21/2016, 4:49 PMadam-mcneilly
12/21/2016, 4:49 PMadam-mcneilly
12/21/2016, 4:50 PMjw
12/21/2016, 4:50 PMkenneth_ford
12/21/2016, 4:50 PMjw
12/21/2016, 4:50 PMkenneth_ford
12/21/2016, 4:50 PMhackerham
12/21/2016, 4:51 PMadam-mcneilly
12/21/2016, 4:51 PMadam-mcneilly
12/21/2016, 4:51 PMwalmyrcarvalho
12/21/2016, 4:55 PM?
operator close to a var
can be misunderstood as a null check (name?
) or somethingwalmyrcarvalho
12/21/2016, 4:56 PMif
is fineadam-mcneilly
12/21/2016, 4:57 PMadam-mcneilly
12/21/2016, 4:57 PMwalmyrcarvalho
12/21/2016, 4:58 PMif
adam-mcneilly
12/21/2016, 4:58 PMadam-mcneilly
12/21/2016, 4:58 PMwalmyrcarvalho
12/21/2016, 4:59 PMadam-mcneilly
12/21/2016, 4:59 PMadam-mcneilly
12/21/2016, 5:05 PMvar hash = if (address != null) address!!.hashCode() else 0
but I'm not entirely sure why smart cast won't work here. I just checked that address isn't null, why do I have to unwrap it? Am I doing this wrong, or is this just how I have to do it?dh44t
12/21/2016, 5:06 PMadam-mcneilly
12/21/2016, 5:06 PMadam-mcneilly
12/21/2016, 5:06 PMjw
12/21/2016, 5:06 PMaddress?.hashCode() ?: 0
dh44t
12/21/2016, 5:07 PMadam-mcneilly
12/21/2016, 5:07 PMvar address1: String? = ""