Added explicit apply method with return type Byte to class ByteString

This is necessary to prevent boxing/unboxing of Bytes on apply.
This commit is contained in:
Oliver Schulz 2012-06-17 22:11:55 +02:00
parent 8d4986dde3
commit 3b67a4fdef

View file

@ -248,6 +248,8 @@ object ByteString {
* TODO: Add performance characteristics
*/
sealed abstract class ByteString extends IndexedSeq[Byte] with IndexedSeqOptimized[Byte, ByteString] {
def apply(idx: Int): Byte
override protected[this] def newBuilder: ByteStringBuilder = ByteString.newBuilder
// *must* be overridden by derived classes. This construction is necessary