Optimize away unneeded FqName computation in KotlinBuiltIns
Before computing the FqName, check the simple class name first. This code was responsible for about 20% of FqNameUnsafe instances created during compilation of "core" modules
This commit is contained in:
@@ -119,9 +119,6 @@ object CollectionLiteralResolver {
|
||||
|
||||
val descriptor = expectedType.constructor.declarationDescriptor ?: return ARRAY_OF_FUNCTION
|
||||
|
||||
val arrayFqName = DescriptorUtils.getFqName(descriptor)
|
||||
val primitiveType = KotlinBuiltIns.getPrimitiveTypeByArrayClassFqName(arrayFqName)
|
||||
|
||||
return PRIMITIVE_TYPE_TO_ARRAY[primitiveType] ?: ARRAY_OF_FUNCTION
|
||||
return PRIMITIVE_TYPE_TO_ARRAY[KotlinBuiltIns.getPrimitiveArrayType(descriptor)] ?: ARRAY_OF_FUNCTION
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user