KtLightField/Method: Use equality in equivalence checks

Avoid computing delegate to determine equivalence
This commit is contained in:
Pavel V. Talanov
2017-03-13 14:40:10 +03:00
parent 8054020f61
commit 48cae0e480
2 changed files with 2 additions and 2 deletions
@@ -117,7 +117,7 @@ sealed class KtLightFieldImpl<T: PsiField>(
}
override fun isEquivalentTo(another: PsiElement?): Boolean {
if (another is KtLightField && kotlinOrigin == another.kotlinOrigin && clsDelegate == another.clsDelegate) {
if (another is KtLightField && this == another) {
return true
}
return super.isEquivalentTo(another)
@@ -179,7 +179,7 @@ class KtLightMethodImpl private constructor(
}
override fun isEquivalentTo(another: PsiElement?): Boolean {
if (another is KtLightMethod && kotlinOrigin == another.kotlinOrigin && clsDelegate == another.clsDelegate) {
if (another is KtLightMethod && this == another) {
return true
}