Invoke equals() on a constant reference 35/21335/2
authorRobert Varga <rovarga@cisco.com>
Thu, 28 May 2015 14:54:54 +0000 (16:54 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 1 Jun 2015 10:50:07 +0000 (10:50 +0000)
Inverting how we perform the equality check makes it obvious that the
invoked method is bound to a specific class object, helping compiler
just a tiny bit.

Change-Id: Ia8209f50143b0c3af71a962ab2a3ab167396836f
Signed-off-by: Robert Varga <rovarga@cisco.com>
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/YangInstanceIdentifier.java

index 85963b6c59c6ac4746a0978af5cf5e6b859cfb6e..60e2f5c8d3fdb917e90c7ea1610b531829f46b16 100644 (file)
@@ -248,7 +248,7 @@ public abstract class YangInstanceIdentifier extends IterablePathArguments imple
             return 0;
         }
 
-        if (value.getClass().equals(byte[].class)) {
+        if (byte[].class.equals(value.getClass())) {
             return Arrays.hashCode((byte[]) value);
         }