Micro optimization to avoid computing class FQ name when not necessary
KotlinBuiltIns.isConstructedFromGivenClass checks the simple name of the class first, and only computes the full FQ name if it matches the last segment of the expected FQ name
This commit is contained in:
+1
-3
@@ -30,8 +30,6 @@ import org.jetbrains.kotlin.resolve.calls.callUtil.getType
|
||||
import org.jetbrains.kotlin.resolve.constants.evaluate.ConstantExpressionEvaluator
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.typeUtil.builtIns
|
||||
import org.jetbrains.kotlin.types.typeUtil.immediateSupertypes
|
||||
import org.jetbrains.kotlin.types.typeUtil.isConstructedFromClassWithGivenFqName
|
||||
import org.jetbrains.kotlin.types.typeUtil.isPrimitiveNumberType
|
||||
|
||||
class ConvertTwoComparisonsToRangeCheckInspection : IntentionBasedInspection<KtBinaryExpression>(
|
||||
@@ -189,4 +187,4 @@ class ConvertTwoComparisonsToRangeCheckIntention : SelfTargetingOffsetIndependen
|
||||
this ?: return false
|
||||
return this.isInteger()|| KotlinBuiltIns.isChar(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user