From bbef89c885a892bfd92f44728bbaf51dd2c3211c Mon Sep 17 00:00:00 2001 From: Godwill Christopher Date: Sun, 12 May 2024 04:37:14 -0600 Subject: [PATCH] refactor: simplify logic of `Point::equals` in `KDTree` (#5158) --- src/main/java/com/thealgorithms/datastructures/trees/KDTree.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/thealgorithms/datastructures/trees/KDTree.java b/src/main/java/com/thealgorithms/datastructures/trees/KDTree.java index cdcbafa5..e5528c39 100644 --- a/src/main/java/com/thealgorithms/datastructures/trees/KDTree.java +++ b/src/main/java/com/thealgorithms/datastructures/trees/KDTree.java @@ -75,7 +75,6 @@ public class KDTree { @Override public boolean equals(Object obj) { if (obj instanceof Point other) { - if (other.getDimension() != this.getDimension()) return false; return Arrays.equals(other.coordinates, this.coordinates); } return false;