xiangfu0 commented on code in PR #8891:
URL: https://github.com/apache/pinot/pull/8891#discussion_r898907993
##########
pinot-spi/src/main/java/org/apache/pinot/spi/utils/ByteArray.java:
##########
@@ -54,6 +53,9 @@ public class ByteArray implements Comparable<ByteArray>,
Serializable {
private final byte[] _bytes;
+ // Hash for empty ByteArray is 1
+ private int _hash = 1;
+
public ByteArray(byte[] bytes) {
Review Comment:
Is this ByteArray reusable? If so, we should reset _hash = 1 here.
Or just have one more boolean represent if hash is already computed in
method `hash()`
--
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]