From 0ab7bafe5e7d1af992d630852ab90a8db536ff10 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Fri, 5 Apr 2024 08:54:58 -0400 Subject: [PATCH] refactored out dependency --- src/engine/mbEnums.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/engine/mbEnums.java b/src/engine/mbEnums.java index 0358f48a..1a8abec3 100644 --- a/src/engine/mbEnums.java +++ b/src/engine/mbEnums.java @@ -35,11 +35,13 @@ import java.util.concurrent.ThreadLocalRandom; public class mbEnums { public static > long toLong(EnumSet enumSet) { - long r = 0; - for (T value : enumSet) { - r |= 1L << value.ordinal(); - } - return r; + + long bitvector = 0L; + + for (T value : enumSet) + bitvector |= 1L << value.ordinal(); + + return bitvector; } public static > EnumSet fromLong(long bitVector, Class enumClass) {