use pattern variables

This commit is contained in:
dfsek
2021-11-27 08:34:03 -07:00
parent 2d316fa042
commit 2307897b31
16 changed files with 33 additions and 58 deletions
@@ -34,8 +34,7 @@ public class Point {
@Override
public boolean equals(Object obj) {
if(!(obj instanceof Point)) return false;
Point that = (Point) obj;
if(!(obj instanceof Point that)) return false;
return this.x == that.x && this.z == that.z;
}
}