Author: dereed
Date: 2012-06-05 19:45:24 -0400 (Tue, 05 Jun 2012)
New Revision: 8495
Modified:
core/trunk/src/test/java/org/jboss/cache/loader/testloaders/DummyInMemoryCacheLoader.java
Log:
[JBCACHE-1615] Improve performance of DummyInMemoryCacheLoader#remove for large caches
Modified:
core/trunk/src/test/java/org/jboss/cache/loader/testloaders/DummyInMemoryCacheLoader.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/loader/testloaders/DummyInMemoryCacheLoader.java 2012-05-25
20:10:11 UTC (rev 8494)
+++
core/trunk/src/test/java/org/jboss/cache/loader/testloaders/DummyInMemoryCacheLoader.java 2012-06-05
23:45:24 UTC (rev 8495)
@@ -217,19 +217,16 @@
debugMessage("Removing fqn " + fqn);
getNodesMap().remove(fqn);
// remove children.
- recursivelyRemoveChildren(fqn);
+ removeChildren(fqn);
}
- private void recursivelyRemoveChildren(Fqn removedParent)
+ private void removeChildren(Fqn removedParent)
{
for (Fqn f : getNodesMap().keySet())
{
- if (f.getParent().equals(removedParent))
+ if (f.isChildOf(removedParent))
{
- // remove the child node too
getNodesMap().remove(f);
- // and it's children. Depth first.
- recursivelyRemoveChildren(f);
}
}
}
Show replies by date