public int indexOf(int value) {
    int ret = binarysearch(value);

    return ret >= 0 ? ret : -1;
  }
Returns the index of the given value, or -1 if the value does not appear in the list. This will
do a binary search if the list is sorted or a linear search if not.

@param value value to find
@return index of value or -1
android/android_framework/dex-maker/src/main/java/com/android/dx/util/IntList.java