Fix "Should be replaced with Kotlin function" warnings
This commit is contained in:
+1
-1
@@ -48,7 +48,7 @@ class ConditionalJumpInstruction(
|
||||
}
|
||||
|
||||
override val nextInstructions: Collection<Instruction>
|
||||
get() = Arrays.asList(nextOnFalse, nextOnTrue)
|
||||
get() = listOf(nextOnFalse, nextOnTrue)
|
||||
|
||||
override val inputValues: List<PseudoValue>
|
||||
get() = listOfNotNull(conditionValue)
|
||||
|
||||
@@ -56,6 +56,7 @@ import org.jetbrains.kotlin.types.typeUtil.containsTypeAliasParameters
|
||||
import org.jetbrains.kotlin.types.typeUtil.containsTypeAliases
|
||||
import org.jetbrains.kotlin.types.typeUtil.isArrayOfNothing
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
import kotlin.math.min
|
||||
|
||||
class TypeResolver(
|
||||
private val annotationResolver: AnnotationResolver,
|
||||
@@ -699,7 +700,7 @@ class TypeResolver(
|
||||
var wasStatic = false
|
||||
val result = SmartList<KtTypeProjection>()
|
||||
|
||||
val classifierChainLastIndex = Math.min(classifierDescriptorChain.size, reversedQualifierParts.size) - 1
|
||||
val classifierChainLastIndex = min(classifierDescriptorChain.size, reversedQualifierParts.size) - 1
|
||||
|
||||
for (index in 0..classifierChainLastIndex) {
|
||||
val qualifierPart = reversedQualifierParts[index]
|
||||
@@ -729,7 +730,7 @@ class TypeResolver(
|
||||
|
||||
val nonClassQualifierParts =
|
||||
reversedQualifierParts.subList(
|
||||
Math.min(classifierChainLastIndex + 1, reversedQualifierParts.size),
|
||||
min(classifierChainLastIndex + 1, reversedQualifierParts.size),
|
||||
reversedQualifierParts.size
|
||||
)
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ import org.jetbrains.kotlin.types.expressions.DoubleColonExpressionResolver
|
||||
import org.jetbrains.kotlin.types.typeUtil.containsTypeProjectionsInTopLevelArguments
|
||||
import org.jetbrains.kotlin.types.typeUtil.makeNotNullable
|
||||
import java.util.*
|
||||
import kotlin.math.min
|
||||
|
||||
class CandidateResolver(
|
||||
private val argumentTypeResolver: ArgumentTypeResolver,
|
||||
@@ -591,7 +592,7 @@ class CandidateResolver(
|
||||
}
|
||||
|
||||
val typeParameters = functionDescriptor.typeParameters
|
||||
for (i in 0..Math.min(typeParameters.size, ktTypeArguments.size) - 1) {
|
||||
for (i in 0..min(typeParameters.size, ktTypeArguments.size) - 1) {
|
||||
val typeParameterDescriptor = typeParameters[i]
|
||||
val typeArgument = typeArguments[i]
|
||||
val typeReference = ktTypeArguments[i].typeReference
|
||||
@@ -686,7 +687,7 @@ class CandidateResolver(
|
||||
// TODO do not perform substitution for type arguments multiple times
|
||||
val substitutedTypeArguments = typeAliasParametersSubstitutor.safeSubstitute(unsubstitutedType, Variance.INVARIANT).arguments
|
||||
|
||||
for (i in 0..Math.min(typeParameters.size, substitutedTypeArguments.size) - 1) {
|
||||
for (i in 0..min(typeParameters.size, substitutedTypeArguments.size) - 1) {
|
||||
val substitutedTypeProjection = substitutedTypeArguments[i]
|
||||
if (substitutedTypeProjection.isStarProjection) continue
|
||||
|
||||
|
||||
Reference in New Issue
Block a user