From 20315baf7d518b5ee8363d53bcc9fecfa253acf5 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Wed, 9 Sep 2009 19:38:19 +0400 Subject: [PATCH] optimization --- .../ide/util/treeView/AbstractTreeStructureBase.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/util/treeView/AbstractTreeStructureBase.java b/platform/lang-impl/src/com/intellij/ide/util/treeView/AbstractTreeStructureBase.java index 3f0ca33ed9..7df9313f92 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/treeView/AbstractTreeStructureBase.java +++ b/platform/lang-impl/src/com/intellij/ide/util/treeView/AbstractTreeStructureBase.java @@ -28,25 +28,23 @@ public abstract class AbstractTreeStructureBase extends AbstractTreeStructure { AbstractTreeNode treeNode = (AbstractTreeNode)element; Collection elements = treeNode.getChildren(); List providers = getProvidersDumbAware(); - Collection modified = new ArrayList(elements); - if (providers != null) { + if (providers != null && !providers.isEmpty()) { for (TreeStructureProvider provider : providers) { - modified = provider.modify(treeNode, modified, ViewSettings.DEFAULT); + elements = provider.modify(treeNode, (Collection)elements, ViewSettings.DEFAULT); } } - for (AbstractTreeNode node : modified) { + for (AbstractTreeNode node : elements) { node.setParent(treeNode); } - return ArrayUtil.toObjectArray(modified); + return ArrayUtil.toObjectArray(elements); } public Object getParentElement(Object element) { if (element instanceof AbstractTreeNode){ return ((AbstractTreeNode)element).getParent(); - } else { - return null; } + return null; } @NotNull -- 2.11.4.GIT