From 2dac5302b36e7b4f22399bd29a045862b153be70 Mon Sep 17 00:00:00 2001 From: vil02 Date: Tue, 28 May 2024 17:28:23 +0200 Subject: [PATCH] style: include `ENMI_EQUALS_ON_ENUM` --- spotbugs-exclude.xml | 3 --- .../com/thealgorithms/datastructures/crdt/LWWElementSet.java | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/spotbugs-exclude.xml b/spotbugs-exclude.xml index 99a24bbff9d5..45ea8ed05d07 100644 --- a/spotbugs-exclude.xml +++ b/spotbugs-exclude.xml @@ -222,9 +222,6 @@ - - - diff --git a/src/main/java/com/thealgorithms/datastructures/crdt/LWWElementSet.java b/src/main/java/com/thealgorithms/datastructures/crdt/LWWElementSet.java index b8b296359844..2c6ce8a427d1 100644 --- a/src/main/java/com/thealgorithms/datastructures/crdt/LWWElementSet.java +++ b/src/main/java/com/thealgorithms/datastructures/crdt/LWWElementSet.java @@ -124,14 +124,14 @@ public void merge(LWWElementSet other) { * @return True if the first element's timestamp is greater or the bias is ADDS and timestamps are equal. */ public boolean compareTimestamps(Element e, Element other) { - if (!e.bias.equals(other.bias)) { + if (e.bias != other.bias) { throw new IllegalArgumentException("Invalid bias value"); } Bias bias = e.bias; int timestampComparison = Integer.compare(e.timestamp, other.timestamp); if (timestampComparison == 0) { - return !bias.equals(Bias.ADDS); + return bias != Bias.ADDS; } return timestampComparison < 0; }