use binary search on ScanRanges.intersect.