He-Pin commented on code in PR #2158:
URL: https://github.com/apache/pekko/pull/2158#discussion_r2327345149


##########
actor-tests/src/test/scala/org/apache/pekko/util/ByteStringSpec.scala:
##########
@@ -701,6 +701,16 @@ class ByteStringSpec extends AnyWordSpec with Matchers 
with Checkers {
       byteString1.indexOf('a', 0) should ===(0)
       byteString1.indexOf('a', 1) should ===(-1)
 
+      val array = Array[Byte]('x', 'y', 'z', 'a', 'b', 'c')
+      val byteString2 = ByteString1(array, 3, 3)
+      byteString2.indexOf('x', -1) should ===(-1)

Review Comment:
   ```java
           fromIndex = Math.max(fromIndex, 0);
           if (fromIndex >= toIndex || buffer.capacity() == 0) {
               return -1;
           }
   ```
   In Netty's Bytebuf, the fromIndex is always >=0



-- 
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