JD557 commented on code in PR #1282:
URL: https://github.com/apache/pekko/pull/1282#discussion_r1566243849
##########
actor/src/main/scala-2.12/org/apache/pekko/util/ByteIterator.scala:
##########
@@ -484,10 +484,10 @@ abstract class ByteIterator extends
BufferedIterator[Byte] {
}
def indexOf(elem: Byte): Int = indexOf(elem, 0)
- def indexOf(elem: Byte, from: Int): Int = indexWhere(_ == elem, from)
+ def indexOf(elem: Byte, from: Int): Int = indexWhere(elem == _, from)
Review Comment:
I think I can remove this change. From the Java documentation:
https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-
> The equals method implements an equivalence relation on non-null object
references:
> [...]
> - It is symmetric: for any non-null reference values x and y, x.equals(y)
should return true if and only if y.equals(x) returns true.
So I think it's OK to assume that the order doesn't matter and it's OK to
have undefined behavior for wrong implementations of equals.
--
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]