B2G/gecko/toolkit/components/url-classifier/tests/unit/test_prefixset.js
// search and requires |arr| to be sorted.
search and requires |arr| to be sorted.
search and requires |arr| to be sorted .
function arrContains(arr, target) {
  let start = 0;
  let end = arr.length - 1;
  let i = 0;
  while (end > start) {
    i = start + (end - start >> 1);
    let value = arr[i];
    if (value < target)
      start = i+1;
    else if (value > target)
      end = i-1;
    else
      break;
  }
  if (start == end)
    i = start;
  return (!(i < 0 || i >= arr.length) && arr[i] == target);
}
function arrContains ( arr , target ) { let start = 0 ; let end = arr . length - 1 ; let i = 0 ; while ( end > start ) { i = start + ( end - start >> 1 ) ; let value = arr [ i ] ; if ( value < target ) start = i + 1 ; else if ( value > target ) end = i - 1 ; else break ; } if ( start == end ) i = start ; return ( ! ( i < 0 || i >= arr . length ) && arr [ i ] == target ) ; }
search and requires |arr| to be sorted.
search and requires |arr| to be sorted .