JD557 commented on code in PR #1247:
URL: https://github.com/apache/pekko/pull/1247#discussion_r1565929000


##########
actor/src/main/scala-3/org/apache/pekko/util/ByteString.scala:
##########
@@ -825,6 +876,32 @@ sealed abstract class ByteString
   // optimized in subclasses
   override def indexOf[B >: Byte](elem: B, from: Int): Int = indexOf(elem, 
from)
 
+  // optimized version of indexOf for bytes, optimized in subclasses
+  /**
+   * Finds index of first occurrence of some byte in this ByteString after or 
at some start index.
+   *
+   * Similar to indexOf, but it avoids boxing if the value is already a byte.
+   *
+   *  @param   elem   the element value to search for.
+   *  @param   from   the start index
+   *  @return  the index `>= from` of the first element of this ByteString 
that is equal (as determined by `==`)
+   *           to `elem`, or `-1`, if none exists.
+   *  @since 1.1.0
+   */
+  def indexOf(elem: Byte, from: Int): Int = indexOf(elem, from)

Review Comment:
   Removed default implementation in 2cce3ea
   
   I think this will fallback to `indexWhere` if nothing is defined (although 
this is always overridden) 



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