packages/flow-remove-types/index.js
// the given offset. Uses binary search for O(log N) performance.
the given offset. Uses binary search for O(log N) performance.
the given offset . Uses binary search for O ( log N ) performance .
function findTokenIndex(tokens, offset) {
  var min = 0;
  var max = tokens.length - 1;
  while (min <= max) {
    var ptr = ((min + max) / 2) | 0;
    var token = tokens[ptr];
    if (endOf(token) <= offset) {
      min = ptr + 1;
    } else if (startOf(token) > offset) {
      max = ptr - 1;
    } else {
      return ptr;
    }
  }
  return ptr;
}
function findTokenIndex ( tokens , offset ) { var min = 0 ; var max = tokens . length - 1 ; while ( min <= max ) { var ptr = ( ( min + max ) / 2 ) | 0 ; var token = tokens [ ptr ] ; if ( endOf ( token ) <= offset ) { min = ptr + 1 ; } else if ( startOf ( token ) > offset ) { max = ptr - 1 ; } else { return ptr ; } } return ptr ; }
the given offset.
the given offset .