Changed MultiByteArrayIterator to operate on a LinearSeq
ByteString.ByteStrings new creates it's iterator on a Stream instead of a List, making ByteStings.iterator an O(1) operation.
This commit is contained in:
parent
93d5e440ea
commit
7a854a9a83
2 changed files with 9 additions and 6 deletions
|
|
@ -211,7 +211,7 @@ object ByteString {
|
|||
} else throw new IndexOutOfBoundsException(idx.toString)
|
||||
|
||||
override def iterator: ByteIterator.MultiByteArrayIterator =
|
||||
ByteIterator.MultiByteArrayIterator(bytestrings.map(_.iterator)(collection.breakOut))
|
||||
ByteIterator.MultiByteArrayIterator(bytestrings.toStream map { _.iterator })
|
||||
|
||||
def ++(that: ByteString): ByteString = {
|
||||
if (that.isEmpty) this
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue