From: Dan Vanderkam Date: Fri, 6 Mar 2015 23:04:45 +0000 (-0500) Subject: Fix inclusive vs. exclusive error in binary search. X-Git-Tag: v2.0.0~72^2~1 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=d5ce61bccb248d7e60239c18068c2ba3aecdb3ec;p=dygraphs.git Fix inclusive vs. exclusive error in binary search. Fixes #554 --- 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) {