diff options
Diffstat (limited to 'src/com/mbien/opencl/CLDevice.java')
-rw-r--r-- | src/com/mbien/opencl/CLDevice.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/com/mbien/opencl/CLDevice.java b/src/com/mbien/opencl/CLDevice.java index d9f643ce..dcc9ee97 100644 --- a/src/com/mbien/opencl/CLDevice.java +++ b/src/com/mbien/opencl/CLDevice.java @@ -191,9 +191,17 @@ public final class CLDevice { @Override public boolean equals(Object obj) { - if(obj != null && obj instanceof CLDevice) - return ((CLDevice)obj).deviceID == deviceID; - return false; + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final CLDevice other = (CLDevice) obj; + if (this.deviceID != other.deviceID) { + return false; + } + return true; } @Override |