mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-08 17:37:42 +01:00
Simplify forDifferencesBetweenArray
This commit is contained in:
parent
9a74051cdb
commit
515b5358da
@ -32,17 +32,14 @@ public final class ArrayUtils {
|
|||||||
|
|
||||||
public static void forDifferencesBetweenArray(long @NotNull [] a, long @NotNull [] b,
|
public static void forDifferencesBetweenArray(long @NotNull [] a, long @NotNull [] b,
|
||||||
@NotNull LongConsumer consumer) {
|
@NotNull LongConsumer consumer) {
|
||||||
|
loop:
|
||||||
for (final long aValue : a) {
|
for (final long aValue : a) {
|
||||||
boolean contains = false;
|
|
||||||
for (final long bValue : b) {
|
for (final long bValue : b) {
|
||||||
if (bValue == aValue) {
|
if (bValue == aValue) {
|
||||||
contains = true;
|
continue loop;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!contains) {
|
consumer.accept(aValue);
|
||||||
consumer.accept(aValue);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user