ss: Bug 485304: Incorrect interval returned in history tree full query
[deliverable/tracecompass.git] / statesystem / org.eclipse.tracecompass.statesystem.core / src / org / eclipse / tracecompass / internal / statesystem / core / backend / historytree / HTNode.java
index 5a44cfd3336d22ed84f0b6152b6fba920604ff0a..b006d190af7412debc039617d4d84f04e6cdfe20 100644 (file)
@@ -537,25 +537,17 @@ public abstract class HTNode {
              */
             index = -index - 1;
 
-        }
-
-        /* Sometimes binarySearch yields weird stuff... */
-        if (index < 0) {
-            index = 0;
-        }
-        if (index >= fIntervals.size()) {
-            index = fIntervals.size() - 1;
-        }
-
-        /*
-         * Another API quirkiness, the returned index is the one of the *last*
-         * element of a series of equal endtimes, which happens sometimes. We
-         * want the *first* element of such a series, to read through them
-         * again.
-         */
-        while (index > 0
-                && fIntervals.get(index - 1).compareTo(fIntervals.get(index)) == 0) {
-            index--;
+        } else {
+            /*
+             * Another API quirkiness, the returned index is the one of the *last*
+             * element of a series of equal endtimes, which happens sometimes. We
+             * want the *first* element of such a series, to read through them
+             * again.
+             */
+            while (index > 0
+                    && fIntervals.get(index - 1).compareTo(fIntervals.get(index)) == 0) {
+                index--;
+            }
         }
 
         return index;
This page took 0.075909 seconds and 5 git commands to generate.