imbajin commented on code in PR #2862:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2862#discussion_r2313277928


##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/id/IdGenerator.java:
##########
@@ -174,25 +186,34 @@ public int compareTo(Id other) {
             if (cmp != 0) {
                 return cmp;
             }
-            return this.id.compareTo(other.asString());
+            if (this.id != null) {
+                return this.id.compareTo(other.asString());
+            } else {
+                return Bytes.compare(this.bytes, other.asBytes());

Review Comment:
   **Performance Optimization**: Consider using `Arrays.equals()` instead of 
`Bytes.equals()` for byte array comparison if `Bytes.equals()` is just a 
wrapper. Also, cache the result of `other.asBytes()` to avoid multiple 
conversions in 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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to