Check self before complex equivalence check in light parameter
This commit is contained in:
+11
-10
@@ -100,19 +100,20 @@ class KtLightParameter(
|
|||||||
override fun getParent(): PsiElement = method.parameterList
|
override fun getParent(): PsiElement = method.parameterList
|
||||||
|
|
||||||
override fun isEquivalentTo(another: PsiElement?): Boolean {
|
override fun isEquivalentTo(another: PsiElement?): Boolean {
|
||||||
val result = ApplicationManager.getApplication().runReadAction(Computable {
|
if (this === another) return true
|
||||||
val kotlinOrigin = kotlinOrigin
|
|
||||||
if (kotlinOrigin?.isEquivalentTo(another) == true) return@Computable true
|
|
||||||
|
|
||||||
if (another is KtLightParameter && kotlinOrigin != null) {
|
return ApplicationManager.getApplication().runReadAction(Computable<Boolean> {
|
||||||
kotlinOrigin == another.kotlinOrigin && clsDelegate == another.clsDelegate
|
if (another is KtParameter) {
|
||||||
} else {
|
val kotlinOrigin = kotlinOrigin
|
||||||
null
|
if (kotlinOrigin?.isEquivalentTo(another) == true) return@Computable true
|
||||||
}
|
}
|
||||||
})
|
|
||||||
result?.let { return it }
|
|
||||||
|
|
||||||
return super.isEquivalentTo(another)
|
if (another is KtLightParameter) {
|
||||||
|
return@Computable kotlinOrigin != null && kotlinOrigin == another.kotlinOrigin && clsDelegate == another.clsDelegate
|
||||||
|
}
|
||||||
|
|
||||||
|
false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean {
|
override fun equals(other: Any?): Boolean {
|
||||||
|
|||||||
Reference in New Issue
Block a user