[SLC] SymbolLightAccessorMethod: simplify equals for psi case
^KT-54051
This commit is contained in:
committed by
Space Team
parent
5c3af11188
commit
2329bd1fe7
+14
-5
@@ -222,16 +222,25 @@ internal class SymbolLightAccessorMethod private constructor(
|
|||||||
|
|
||||||
override fun equals(other: Any?): Boolean {
|
override fun equals(other: Any?): Boolean {
|
||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
if (other !is SymbolLightAccessorMethod || other.ktModule != ktModule || other.isGetter != isGetter) return false
|
if (other !is SymbolLightAccessorMethod ||
|
||||||
if (propertyAccessorDeclaration != null) {
|
other.isGetter != isGetter ||
|
||||||
|
other.isTopLevel != isTopLevel ||
|
||||||
|
other.suppressStatic != suppressStatic ||
|
||||||
|
other.ktModule != ktModule
|
||||||
|
) return false
|
||||||
|
|
||||||
|
if (propertyAccessorDeclaration != null || other.propertyAccessorDeclaration != null) {
|
||||||
return propertyAccessorDeclaration == other.propertyAccessorDeclaration
|
return propertyAccessorDeclaration == other.propertyAccessorDeclaration
|
||||||
}
|
}
|
||||||
|
|
||||||
return other.propertyAccessorDeclaration == null &&
|
if (containingPropertyDeclaration != null || other.containingPropertyDeclaration != null) {
|
||||||
compareSymbolPointers(ktModule, propertyAccessorSymbolPointer, other.propertyAccessorSymbolPointer)
|
return containingPropertyDeclaration == other.containingPropertyDeclaration
|
||||||
|
}
|
||||||
|
|
||||||
|
return compareSymbolPointers(ktModule, propertyAccessorSymbolPointer, other.propertyAccessorSymbolPointer)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int = propertyAccessorDeclaration.hashCode()
|
override fun hashCode(): Int = propertyAccessorDeclaration?.hashCode() ?: containingPropertyDeclaration.hashCode()
|
||||||
|
|
||||||
private val _parametersList by lazyPub {
|
private val _parametersList by lazyPub {
|
||||||
val parameterPopulator: (LightParameterListBuilder) -> Unit = if (!isGetter) {
|
val parameterPopulator: (LightParameterListBuilder) -> Unit = if (!isGetter) {
|
||||||
|
|||||||
Reference in New Issue
Block a user