From 315a97d677461974c3624117e67b7c936e6048da Mon Sep 17 00:00:00 2001 From: TheMode Date: Sat, 27 May 2023 15:36:06 +0200 Subject: [PATCH] Inline array initialization Signed-off-by: TheMode (cherry picked from commit 9b15acf4fa1b4241f23a0f6e6a832930164b1381) --- .../net/minestom/server/tag/Serializers.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/main/java/net/minestom/server/tag/Serializers.java b/src/main/java/net/minestom/server/tag/Serializers.java index 30ea932cc..179565060 100644 --- a/src/main/java/net/minestom/server/tag/Serializers.java +++ b/src/main/java/net/minestom/server/tag/Serializers.java @@ -59,18 +59,14 @@ final class Serializers { } private static int[] uuidToIntArray(UUID uuid) { - int[] array = new int[4]; - final long uuidMost = uuid.getMostSignificantBits(); final long uuidLeast = uuid.getLeastSignificantBits(); - - array[0] = (int) (uuidMost >> 32); - array[1] = (int) uuidMost; - - array[2] = (int) (uuidLeast >> 32); - array[3] = (int) uuidLeast; - - return array; + return new int[]{ + (int) (uuidMost >> 32), + (int) uuidMost, + (int) (uuidLeast >> 32), + (int) uuidLeast + }; } private static UUID intArrayToUuid(int[] array) {