Optimize getFqName calls in KotlinBuiltIns
Check the simple name first, and only then construct the full FqName, in all 'is*' methods
This commit is contained in:
+1
-1
@@ -61,7 +61,7 @@ private class ClassClsStubBuilder(
|
||||
private val supertypeIds = run {
|
||||
val supertypeIds = classProto.supertypes(c.typeTable).map { c.nameResolver.getClassId(it.className) }
|
||||
//empty supertype list if single supertype is Any
|
||||
if (supertypeIds.singleOrNull()?.let { KotlinBuiltIns.isAny(it.asSingleFqName().toUnsafe()) } ?: false) {
|
||||
if (supertypeIds.singleOrNull()?.let { KotlinBuiltIns.FQ_NAMES.any == it.asSingleFqName().toUnsafe() } ?: false) {
|
||||
listOf()
|
||||
}
|
||||
else {
|
||||
|
||||
+1
-1
@@ -253,7 +253,7 @@ class TypeClsStubBuilder(private val c: ClsStubBuilderContext) {
|
||||
|
||||
private fun Type.isDefaultUpperBound(): Boolean {
|
||||
return this.hasClassName() &&
|
||||
c.nameResolver.getClassId(className).let { KotlinBuiltIns.isAny(it.asSingleFqName().toUnsafe()) } &&
|
||||
c.nameResolver.getClassId(className).let { KotlinBuiltIns.FQ_NAMES.any == it.asSingleFqName().toUnsafe() } &&
|
||||
this.nullable
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user