From 0724b8639bf1a87a2120655f0296c7d116e91771 Mon Sep 17 00:00:00 2001 From: MrGazdag <44264503+MrGazdag@users.noreply.github.com> Date: Sat, 17 Jul 2021 21:20:10 +0200 Subject: [PATCH] Fix ArrayUtils#sameStart Fixes #370, which was a weird occurrence of this bug lmao --- src/main/java/net/minestom/server/utils/ArrayUtils.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/minestom/server/utils/ArrayUtils.java b/src/main/java/net/minestom/server/utils/ArrayUtils.java index 4a1e077cd..b25332366 100644 --- a/src/main/java/net/minestom/server/utils/ArrayUtils.java +++ b/src/main/java/net/minestom/server/utils/ArrayUtils.java @@ -94,11 +94,9 @@ public final class ArrayUtils { for (int i = 0; i < length; i++) { final T value1 = array1[i]; - for (int j = 0; j < length; j++) { - final T value2 = array2[j]; - if (!value1.equals(value2)) { - return false; - } + final T value2 = array2[i]; + if (!value1.equals(value2)) { + return false; } } return true;