mirror of
https://github.com/nasa/openmct.git
synced 2025-04-17 15:59:09 +00:00
[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:
parent
de99969f0a
commit
53369ec0dc
@ -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());
|
||||
|
Loading…
x
Reference in New Issue
Block a user