From f5e5a863592c7e4f65e2a8d0d7c4c356e021321d 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 d2c5bbf..7cd3c78 100644 --- a/extras/synchronizer.js +++ b/extras/synchronizer.js @@ -204,7 +204,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