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: v1.1.1~7 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=f5e5a863592c7e4f65e2a8d0d7c4c356e021321d;p=dygraphs.git Fix inclusive vs. exclusive error in binary search. Fixes #554 --- 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) {