From d96b79cb235e51f27f7ed3004e640f985a901a66 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Thu, 26 Aug 2010 17:44:41 +0400 Subject: [PATCH] performance: avoid unnecessary PSI loading --- .../src/com/jetbrains/python/psi/impl/PyClassImpl.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/python/src/com/jetbrains/python/psi/impl/PyClassImpl.java b/python/src/com/jetbrains/python/psi/impl/PyClassImpl.java index 172c409a1aae..839c52c63e87 100644 --- a/python/src/com/jetbrains/python/psi/impl/PyClassImpl.java +++ b/python/src/com/jetbrains/python/psi/impl/PyClassImpl.java @@ -371,8 +371,10 @@ public class PyClassImpl extends PyPresentableElementImpl implement // NOTE: fast enough to be rerun every time Property prop = lookInDecoratedProperties(name_filter, property_filter, advanced); if (prop != null) return prop; - prop = lookInStubProperties(name_filter, property_filter); - if (prop != null) return prop; + if (getStub() != null) { + prop = lookInStubProperties(name_filter, property_filter); + if (prop != null) return prop; + } else { // name = property(...) assignments from PSI for (PyTargetExpression target : getClassAttributes()) { @@ -737,8 +739,8 @@ public class PyClassImpl extends PyPresentableElementImpl implement if (containingFile instanceof PyFile) { final PsiElement element = ((PyFile)containingFile).findExportedName(PyNames.METACLASS); if (element instanceof PyTargetExpression) { - final PyExpression assignedValue = ((PyTargetExpression)element).findAssignedValue(); - if (assignedValue != null && assignedValue.getText().equals("type")) { + final PyQualifiedName qName = ((PyTargetExpression)element).getAssignedQName(); + if (qName != null && qName.matches("type")) { return true; } }