Karlo Lozovina
03/26/2021, 2:54 PM!!
operator have any overhead, if the value is never null
? I'm guessing no, but still...Zach Klippenstein (he/him) [MOD]
03/26/2021, 3:01 PMNir
03/26/2021, 3:02 PMKarlo Lozovina
03/26/2021, 3:13 PMKarlo Lozovina
03/26/2021, 3:14 PM!!
besides what the Java code would have?Albert Chang
03/26/2021, 3:17 PMIntrinsics.checkNotNull()
calls. It should be trivial when the parameter is not null but if you really care you can use code shrinkers such as ProGuard or R8 to strip out the calls.ephemient
03/26/2021, 3:17 PMIntrinsics.throwNpe()
Karlo Lozovina
03/26/2021, 3:19 PMephemient
03/26/2021, 3:19 PMAlbert Chang
03/26/2021, 3:19 PMIntrinsics.throwJavaNpe()
since Kotlin 1.4 and it’s called inside Intrinsics.checkNotNull()
.Karlo Lozovina
03/26/2021, 3:21 PMephemient
03/26/2021, 3:21 PMephemient
03/26/2021, 3:22 PMjavap -v
on the emitted classfile, or use the built-in IDE decompilerNir
03/26/2021, 3:24 PMephemient
03/26/2021, 5:35 PMephemient
03/26/2021, 5:38 PMNir
03/26/2021, 5:54 PMNir
03/26/2021, 5:55 PMephemient
03/26/2021, 7:09 PM