Replace deprecated usages of max/min with maxOrNull/minOrNull

This commit is contained in:
Alexander Udalov
2020-08-13 18:14:02 +02:00
parent 81dda96ece
commit a9ddf02556
48 changed files with 86 additions and 84 deletions
@@ -431,7 +431,7 @@ open class KotlinMPPGradleProjectResolver : AbstractProjectResolverExtensionComp
sourceSetToCompilationData[sourceSet.name]?.let { compilationDataRecords ->
it.targetCompatibility = compilationDataRecords
.mapNotNull { compilationData -> compilationData.targetCompatibility }
.minWith(VersionComparatorUtil.COMPARATOR)
.minWithOrNull(VersionComparatorUtil.COMPARATOR)
if (sourceSet.actualPlatforms.getSinglePlatform() == KotlinPlatform.NATIVE) {
it.konanTargets = compilationDataRecords
@@ -109,7 +109,7 @@ class KlibInfoProvider(kotlinNativeHome: File) {
1 -> candidates.single()
else -> {
// there are multiple components, let's take just the first one alphabetically
candidates.minBy { it.getName(it.nameCount - 2).toString() }!!
candidates.minByOrNull { it.getName(it.nameCount - 2).toString() }!!
}
}
}