title: Fastest way to find if int array contains a number
body: <p>This is an odd question. I have an integer array in Java, where each int represents a color. They will either be 0xFFFFFFFF or 0x0. What would be the FASTEST way to find if this array contains ANY values equal to 0xFFFFFFFF?</p>
  
  <p>This is my current code: </p>
  
  <pre><code>int length = w * h;
  for (int i = 0; i &lt; length; i++) {
      if (pixels[i] == 0xFFFFFFFF) {
          return true;
      }
  }
  </code></pre>
  
  <p>I have no clue if there is a faster way to do this or not. I imagine you vets could have a trick or two though.</p>
  
  <p>EDIT: Seeing as it is just a dumb array of pixels from Bitmap.getPixels(), there's no way it would be sorted or transformed to another storage structure. Thanks for the input, everyone, it seems like looping through is the best way in this case.</p>