Refactor Device#equals method

This commit is contained in:
Ehren Kret 2022-04-19 09:08:10 -05:00
parent 473ecbdf2d
commit 796fb3b4cd
1 changed files with 1 additions and 4 deletions

View File

@ -253,10 +253,7 @@ public class Device {
@Override
public boolean equals(Object other) {
if (other == null || !(other instanceof Device)) return false;
Device that = (Device)other;
return this.id == that.id;
return (other instanceof Device that) && this.id == that.id;
}
@Override