Minor optimization in KotlinBuiltIns.isSpecialClassWithNoSupertypes

This commit is contained in:
Alexander Udalov
2014-05-14 22:28:52 +04:00
parent 5fdb9e6218
commit 3ffa7cdcf8
4 changed files with 7 additions and 6 deletions
@@ -143,6 +143,8 @@ public class KotlinBuiltIns {
}
private static class FqNames {
public final FqNameUnsafe any = fqName("Any");
public final FqNameUnsafe nothing = fqName("Nothing");
public final FqNameUnsafe suppress = fqName("suppress");
@NotNull
@@ -792,10 +794,9 @@ public class KotlinBuiltIns {
// Recognized & special
public static boolean isSpecialClassWithNoSupertypes(@NotNull ClassDescriptor descriptor) {
public boolean isSpecialClassWithNoSupertypes(@NotNull ClassDescriptor descriptor) {
FqNameUnsafe fqName = DescriptorUtils.getFqName(descriptor);
return BUILT_INS_PACKAGE_FQ_NAME.child(Name.identifier("Any")).toUnsafe().equals(fqName) ||
BUILT_INS_PACKAGE_FQ_NAME.child(Name.identifier("Nothing")).toUnsafe().equals(fqName);
return fqNames.any.equals(fqName) || fqNames.nothing.equals(fqName);
}
public boolean isNothing(@NotNull JetType type) {