Fix inclusive vs. exclusive error in binary search.
authorDan Vanderkam <danvdk@gmail.com>
Fri, 6 Mar 2015 23:04:45 +0000 (18:04 -0500)
committerRobert Konigsberg <konigsberg@google.com>
Tue, 26 May 2015 20:54:48 +0000 (16:54 -0400)
Fixes #554

extras/synchronizer.js

index d2c5bbf..7cd3c78 100644 (file)
@@ -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) {