From 75bdf96ff7e8ccbf5c3b2c8eeaa0d3a4ba2dafb8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Genevi=C3=A8ve=20Bastien?= Date: Thu, 23 Feb 2017 15:27:18 -0500 Subject: [PATCH] datastore: Fast return to for classic node children MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When selecting next children of classic nodes, once the node's end time is past the maximum of the range, it is no use searching the rest of the children. Change-Id: I7a1aba410718ea33a84b6a0b109121b0512fd284 Signed-off-by: Geneviève Bastien Reviewed-on: https://git.eclipse.org/r/91758 Reviewed-by: Hudson CI Reviewed-by: Loic Prieur-Drevon --- .../datastore/core/historytree/classic/ClassicNode.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/statesystem/org.eclipse.tracecompass.datastore.core/src/org/eclipse/tracecompass/internal/provisional/datastore/core/historytree/classic/ClassicNode.java b/statesystem/org.eclipse.tracecompass.datastore.core/src/org/eclipse/tracecompass/internal/provisional/datastore/core/historytree/classic/ClassicNode.java index c5c610f4e7..bf209becf4 100644 --- a/statesystem/org.eclipse.tracecompass.datastore.core/src/org/eclipse/tracecompass/internal/provisional/datastore/core/historytree/classic/ClassicNode.java +++ b/statesystem/org.eclipse.tracecompass.datastore.core/src/org/eclipse/tracecompass/internal/provisional/datastore/core/historytree/classic/ClassicNode.java @@ -142,6 +142,7 @@ public class ClassicNode extends HTNode { return Collections.EMPTY_LIST; } + long end = rc.max(); List matchingChildren = new LinkedList<>(); /* Check all children except the last one */ for (int i = 0; i < nbChildren - 1; i++) { @@ -152,6 +153,9 @@ public class ClassicNode extends HTNode { if (rc.intersects(childStart, childEnd)) { matchingChildren.add(i); } + if (end <= childEnd) { + return matchingChildren; + } } /* Check the last child */ -- 2.34.1