From d5ce61bccb248d7e60239c18068c2ba3aecdb3ec Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Fri, 6 Mar 2015 18:04:45 -0500 Subject: [PATCH] Fix inclusive vs. exclusive error in binary search. Fixes #554 --- extras/synchronizer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/synchronizer.js b/extras/synchronizer.js index f39209b..cbe26d2 100644 --- a/extras/synchronizer.js +++ b/extras/synchronizer.js @@ -200,7 +200,7 @@ function dygraphsBinarySearch(g, xVal) { var low = 0, high = g.numRows() - 1; - while (low < high) { + while (low <= high) { var idx = (high + low) >> 1; var x = g.getValue(idx, 0); if (x < xVal) { -- 2.7.4