Improved implementation of ByteStrings.iterator

This commit is contained in:
Oliver Schulz 2012-05-18 17:36:16 +02:00
parent a032603858
commit 7d3edcddbc

View file

@ -206,7 +206,7 @@ object ByteString {
bytestrings(pos)(idx - seen)
} else throw new IndexOutOfBoundsException(idx.toString)
override def iterator = MultiByteArrayIterator(bytestrings.toList.map { _.iterator })
override def iterator = MultiByteArrayIterator(bytestrings.map(_.iterator)(collection.breakOut))
def ++(that: ByteString): ByteString = {
if (that.isEmpty) this