Dead code

This commit is contained in:
themode 2022-03-07 13:55:13 +01:00
parent 29f55ee720
commit 3764e83a4f

View File

@ -68,33 +68,4 @@ public final class ArrayUtils {
default -> Map.copyOf(new Object2ObjectArrayMap<>(keys, values, length));
};
}
private static final int INDEX_NOT_FOUND = -1;
public static int indexOf(final Object[] array, final Object objectToFind) {
return indexOf(array, objectToFind, 0);
}
public static int indexOf(final Object[] array, final Object objectToFind, int startIndex) {
if (array == null) {
return INDEX_NOT_FOUND;
}
if (startIndex < 0) {
startIndex = 0;
}
if (objectToFind == null) {
for (int i = startIndex; i < array.length; i++) {
if (array[i] == null) {
return i;
}
}
} else {
for (int i = startIndex; i < array.length; i++) {
if (objectToFind.equals(array[i])) {
return i;
}
}
}
return INDEX_NOT_FOUND;
}
}