You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2020/04/24 14:48:21 UTC

[GitHub] [accumulo] EdColeman commented on a change in pull request #1595: Update manual array to collections copy method.

EdColeman commented on a change in pull request #1595:
URL: https://github.com/apache/accumulo/pull/1595#discussion_r414634649



##########
File path: core/src/main/java/org/apache/accumulo/core/data/Key.java
##########
@@ -1159,7 +1159,7 @@ public int getSize() {
   }
 
   private static boolean isEqual(byte[] a1, byte[] a2) {
-    if (a1 == a2)
+    if (Arrays.equals(a1, a2))

Review comment:
       I'm not sure this keeps the same behaviour. The == will test if the passed arrays are the same reference.  Replacing with Arrays.equals is also going to check if the contents are the same.  This would make the rest of the test redundant - and from the code comments is trying to optimize the comparison. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org