You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that multiple methods inside Bytes use the byteAt method in loops. It would be more efficient to access the array directly because byteAt does sanity checks for each access. It would better to sanity check the entire range before the loop and directly access the array inside the loop. This improvement could be made to at least the following methods : hashCode() and compareTo.
The text was updated successfully, but these errors were encountered:
Could we use the java helper methods like Objects.hashCode(this);for hashCode() in Bytes like is used in the rest of the API?
@cjmctague if you can find something. I couldn't find a built in java method that takes an offset and length. Java has Arrays.hashCode(byte[]), but to use this we would need to create a new byte array and copy to it. Too bad java doesn't have Arrays.hashCode(byte[] data, int offset, int len)
I noticed that multiple methods inside Bytes use the
byteAt
method in loops. It would be more efficient to access the array directly becausebyteAt
does sanity checks for each access. It would better to sanity check the entire range before the loop and directly access the array inside the loop. This improvement could be made to at least the following methods :hashCode()
andcompareTo
.The text was updated successfully, but these errors were encountered: