Browse Source

Performance tweak by avoiding iteration over whole model for each context element.

Thomas Kutz 9 years ago
parent
commit
a8d9c10539

+ 1 - 1
plugins/org.yakindu.sct.model.stext/src/org/yakindu/sct/model/stext/scoping/StextImportAwareScopeProvider.java

@@ -42,7 +42,7 @@ public class StextImportAwareScopeProvider extends ImportedNamespaceAwareLocalSc
 		List<ImportScope> importScopes = new ArrayList<ImportScope>();
 		if (context instanceof StateSpecification || context instanceof TransitionSpecification) {
 			importScopes = EcoreUtil2.getAllContentsOfType(getStatechart(context), ImportScope.class);
-		} else {
+		} else if (context instanceof Statechart) {
 			importScopes = EcoreUtil2.getAllContentsOfType(context, ImportScope.class);
 		}
 		for (ImportScope scope : importScopes) {