File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
processor/src/main/kotlin/com/tobrun/datacompat Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -236,16 +236,11 @@ class DataCompatProcessor(
236
236
toClassName() == Float ::class .asTypeName()
237
237
val isDouble =
238
238
toClassName() == Double ::class .asTypeName()
239
- if (isFloat || isDouble) {
240
- if (isMarkedNullable && isDouble) {
241
- " ($it ·?:·0.0).compareTo(other.$it ·?:·0.0)·==·0"
242
- } else if (isMarkedNullable && isFloat) {
243
- " ($it ·?:·0f).compareTo(other.$it ·?:·0f)·==·0"
244
- } else {
245
- " $it .compareTo(other.$it )·==·0"
246
- }
247
- } else {
248
- " $it ·==·other.$it "
239
+ when {
240
+ ! isMarkedNullable && (isDouble || isFloat) -> " $it .compareTo(other.$it )·==·0"
241
+ isMarkedNullable && isDouble -> " ($it ·?:·0.0).compareTo(other.$it ·?:·0.0)·==·0"
242
+ isMarkedNullable && isFloat -> " ($it ·?:·0f).compareTo(other.$it ·?:·0f)·==·0"
243
+ else -> " $it ·==·other.$it "
249
244
}
250
245
}
251
246
},
You can’t perform that action at this time.
0 commit comments