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; }