Replace deprecated usages of max/min with maxOrNull/minOrNull
This commit is contained in:
+1
-1
@@ -197,7 +197,7 @@ object SourceNavigationHelper {
|
||||
): T? {
|
||||
val classFqName = entity.fqName ?: return null
|
||||
return targetScopes(entity, navigationKind).firstNotNullResult { scope ->
|
||||
index.get(classFqName.asString(), entity.project, scope).minBy { it.isExpectDeclaration() }
|
||||
index.get(classFqName.asString(), entity.project, scope).minByOrNull { it.isExpectDeclaration() }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ fun getLibraryLanguageLevel(
|
||||
): LanguageVersion {
|
||||
val minVersion = getRuntimeLibraryVersions(module, rootModel, platformKind.orDefault())
|
||||
.addReleaseVersionIfNecessary(coerceRuntimeLibraryVersionToReleased)
|
||||
.minWith(VersionComparatorUtil.COMPARATOR)
|
||||
.minWithOrNull(VersionComparatorUtil.COMPARATOR)
|
||||
return getDefaultLanguageLevel(module, minVersion, coerceRuntimeLibraryVersionToReleased)
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ fun getDefaultLanguageLevel(
|
||||
?: KotlinVersionInfoProvider.EP_NAME.extensions
|
||||
.mapNotNull { it.getCompilerVersion(module) }
|
||||
.addReleaseVersionIfNecessary(coerceRuntimeLibraryVersionToReleased)
|
||||
.minWith(VersionComparatorUtil.COMPARATOR)
|
||||
.minWithOrNull(VersionComparatorUtil.COMPARATOR)
|
||||
?: return VersionView.RELEASED_VERSION
|
||||
return libVersion.toLanguageVersion()
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ open class KotlinPsiChecker : AbstractKotlinPsiChecker() {
|
||||
}
|
||||
|
||||
private fun createQuickFixes(similarDiagnostics: Collection<Diagnostic>): MultiMap<Diagnostic, IntentionAction> {
|
||||
val first = similarDiagnostics.minBy { it.toString() }
|
||||
val first = similarDiagnostics.minByOrNull { it.toString() }
|
||||
val factory = similarDiagnostics.first().getRealDiagnosticFactory()
|
||||
|
||||
val actions = MultiMap<Diagnostic, IntentionAction>()
|
||||
|
||||
Reference in New Issue
Block a user