pjfanning commented on code in PR #2324:
URL: https://github.com/apache/pekko/pull/2324#discussion_r3035601784
##########
actor/src/main/scala/org/apache/pekko/util/ByteString.scala:
##########
@@ -575,6 +668,86 @@ object ByteString {
else -1
}
+ // Derived from code in Netty
+ //
https://github.com/netty/netty/blob/d28a0fc6598b50fbe8f296831777cf4b653a475f/buffer/src/main/java/io/netty/buffer/ByteBufUtil.java#L242-L325
+ override def indexOfSlice(slice: Array[Byte], from: Int): Int = {
+ val n = length - from
+ val m = slice.length
+ if (m == 0) return 0
+ // When the needle has only one byte that can be read,
+ // the indexOf() can be used
+ if (m == 1) return indexOf(slice.head, from)
+ var i = 0
+ var j = 0
+ val aStartIndex = 0
+ val bStartIndex = from + startIndex
+ val suffixes = SWARUtil.maxSuf(slice, m, aStartIndex, true)
Review Comment:
fixed
--
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]