From 0c7de981950b7bad0f59679da6ff4527b1960d6d Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 24 Sep 2015 12:18:47 -0700 Subject: [PATCH] [Time Conductor] Use active domain in binary search --- .../features/conductor/src/ConductorTelemetrySeries.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/platform/features/conductor/src/ConductorTelemetrySeries.js b/platform/features/conductor/src/ConductorTelemetrySeries.js index 98cebe0907..d2f7c874cc 100644 --- a/platform/features/conductor/src/ConductorTelemetrySeries.js +++ b/platform/features/conductor/src/ConductorTelemetrySeries.js @@ -38,13 +38,14 @@ define( * @implements {TelemetrySeries} */ function ConductorTelemetrySeries(series, conductor) { - var max = series.getPointCount() - 1; + var max = series.getPointCount() - 1, + domain = conductor.activeDomain(); function binSearch(min, max, value) { var mid = Math.floor((min + max) / 2); return min > max ? min : - series.getDomainValue(mid) < value ? + series.getDomainValue(mid, domain) < value ? binSearch(mid + 1, max, value) : binSearch(min, mid - 1, value); } @@ -52,7 +53,7 @@ define( this.startIndex = binSearch(0, max, conductor.displayStart()); this.endIndex = binSearch(0, max, conductor.displayEnd()); this.series = series; - this.domain = conductor.activeDomain(); + this.domain = domain; } ConductorTelemetrySeries.prototype.getPointCount = function () {