mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-25 02:27:38 +01:00
Dead code
This commit is contained in:
parent
29f55ee720
commit
3764e83a4f
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user