[lc] decompiled: make isEquivalentTo lightweight

^KT-53934 Fixed
This commit is contained in:
Dmitry Gridin
2022-09-09 13:50:54 +02:00
committed by Space
parent 194dae11b9
commit d13f2af6ec
2 changed files with 12 additions and 0 deletions
@@ -71,4 +71,10 @@ open class KtLightFieldForDecompiledDeclaration(
override fun toString(): String = "${this.javaClass.simpleName} of $fldParent"
override fun isValid(): Boolean = parent.isValid
override fun isEquivalentTo(another: PsiElement?): Boolean {
return this == another ||
another is KtLightFieldForDecompiledDeclaration && fldDelegate.isEquivalentTo(another.fldDelegate) ||
fldDelegate.isEquivalentTo(another)
}
}
@@ -103,6 +103,12 @@ class KtLightMethodForDecompiledDeclaration(
override fun isValid(): Boolean = parent.isValid
override fun getOriginalElement() = funDelegate
override fun isEquivalentTo(another: PsiElement?): Boolean {
return this == another ||
another is KtLightMethodForDecompiledDeclaration && funDelegate.isEquivalentTo(another.funDelegate) ||
funDelegate.isEquivalentTo(another)
}
}
private fun KtLightMethod.checkIsMangled(): Boolean {