Shortcut equals test when objects are the same instance

This commit is contained in:
Jeremy Lakeman 2014-03-27 13:32:15 +10:30
parent 89f6d533cd
commit f6f1752437

View File

@ -82,6 +82,8 @@ public abstract class AbstractId {
// must be the exact same type with the same binary contents to be considered equal
if (other==null)
return false;
if (other==this)
return true;
if (other.getClass() == this.getClass()) {
AbstractId oBinary = (AbstractId) other;
for (int i = 0; i < this.binary.length; i++)