Optimization of PsiClassImplUtil.isMethodEquivalentTo()

This commit is contained in:
Sergey Evdokimov
2012-02-13 14:42:36 +04:00
parent 870847783b
commit 3d73f7cc7e
@@ -984,12 +984,11 @@ public class PsiClassImplUtil {
}
public static boolean isMethodEquivalentTo(PsiMethod method1, PsiElement another) {
if (method1 == another) return true;
if (!(another instanceof PsiMethod)) return false;
PsiMethod method2 = (PsiMethod)another;
String name1 = method1.getName();
if (!another.isValid()) return false;
String name2 = method2.getName();
if (!name1.equals(name2)) return false;
if (!method1.getName().equals(method2.getName())) return false;
PsiClass aClass1 = method1.getContainingClass();
PsiClass aClass2 = method2.getContainingClass();
PsiManager manager = method1.getManager();