Commit aa419461 authored by Ethan Ordentlich's avatar Ethan Ordentlich
Browse files

Correct equals in Point.java

1 merge request!1Correct equals in Point.java
Pipeline #10062 failed with stage
in 0 seconds
Showing with 6 additions and 3 deletions
+6 -3
......@@ -28,9 +28,12 @@ public class Point {
*/
@Override
public boolean equals(Point point) {
if (point == null) return false;
int x = point.x;
int y = point.y;
if (!(point instanceof Point)) {
return false;
}
Point p = (Point) point;
int x = p.x;
int y = p.y;
return (this.x == x && this.y == y);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment