diff options
author | Ian Bull | 2012-11-19 20:57:21 +0000 |
---|---|---|
committer | Ian Bull | 2012-11-19 20:57:21 +0000 |
commit | a63347a8fc10f3585c71cf5bddee00cc5abafbb2 (patch) | |
tree | 9844d5078a3c81516b0787765270035d7b3f13d0 | |
parent | c25f316ce3aa843c20cd208a8f7d43b36be2dc01 (diff) | |
download | rt.equinox.p2-a63347a8fc10f3585c71cf5bddee00cc5abafbb2.tar.gz rt.equinox.p2-a63347a8fc10f3585c71cf5bddee00cc5abafbb2.tar.xz rt.equinox.p2-a63347a8fc10f3585c71cf5bddee00cc5abafbb2.zip |
Bug 384646: Improves the performance of the install software filter.v20121119-205721
This changeset results in caching the children in a category, so each
time a key is typed we don't need to compute it.
-rw-r--r-- | bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElement.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElement.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElement.java index a478e683f..451cfc74b 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElement.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElement.java @@ -66,6 +66,10 @@ public abstract class QueriedElement extends ProvElement { } public Object[] getChildren(Object o) { + Object[] cache = getCachedChildren(); + if (cache.length > 0) { + return getCachedChildren(); + } return fetchChildren(o, new NullProgressMonitor()); } @@ -159,6 +163,9 @@ public abstract class QueriedElement extends ProvElement { } public Object[] getCachedChildren() { + if (cachedChildren == null) { + return new Object[0]; + } return cachedChildren.toArray(); } |