You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@fluo.apache.org by gi...@git.apache.org on 2017/10/03 02:05:17 UTC

[GitHub] keith-turner commented on a change in pull request #934: Fluo Issue #924

keith-turner commented on a change in pull request #934: Fluo Issue #924
URL: https://github.com/apache/fluo/pull/934#discussion_r142297198
 
 

 ##########
 File path: modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java
 ##########
 @@ -228,15 +258,30 @@ public final boolean equals(Object other) {
     if (other instanceof Bytes) {
       Bytes ob = (Bytes) other;
 
-      if (length != ob.length) {
-        return false;
-      }
-
-      return compareTo(ob) == 0;
+      return contentEquals(ob.data, ob.offset, ob.length);
     }
     return false;
   }
 
+  /**
+   * Returns true if this Bytes object equals another.
+   */
+  public boolean contentEquals(byte[] bytes) {
+    return contentEquals(bytes, 0, bytes.length);
+  }
+
+  /**
+   * Returns true if this Bytes object equals another.
 
 Review comment:
   This javadoc needs a `@since 1.2.0` tag
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services