[Time Conductor] Avoid searching outside of series

Don't look up domain values while subsetting a
telemetry series until after checking to ensure
that there is some segment of the series left
to search. WTD-1515
This commit is contained in:
Victor Woeltjen 2015-09-14 16:36:41 -07:00
parent de99969f0a
commit 53369ec0dc

View File

@ -8,12 +8,12 @@ define(
var max = series.getPointCount() - 1;
function binSearch(min, max, value) {
var mid = Math.floor((min + max) / 2),
domainValue = series.getDomainValue(mid);
var mid = Math.floor((min + max) / 2);
return min >= max ? min :
domainValue < value ? binSearch(mid + 1, max, value) :
binSearch(min, mid - 1, value);
series.getDomainValue(mid) < value ?
binSearch(mid + 1, max, value) :
binSearch(min, mid - 1, value);
}
this.startIndex = binSearch(0, max, conductor.displayStart());