Remove unnecesary drop() from ByteString1.writeToBuffer(ByteBuffer) (#25151)

I found a strange call to `drop()` in `ByteString1.writeToBuffer(ByteBuffer)`. `drop()` instantiates a new `ByteString1` which is immediately discarded to GC. Appears unnecessary.

Removing it makes the `ByteString1` implementation match the one `ByteString1C`.
This commit is contained in:
Doug Roper 2018-05-29 07:13:07 -04:00 committed by Konrad `ktoso` Malawski
parent 73284fd897
commit 034f6c5c96
2 changed files with 1 additions and 2 deletions

View file

@ -611,7 +611,7 @@ class ByteStringSpec extends WordSpec with Matchers with Checkers {
"dropping" in { check((a: ByteString, b: ByteString) (a ++ b).drop(b.size).size == a.size) }
"taking" in { check((a: ByteString, b: ByteString) (a ++ b).take(a.size) == a) }
"takingRight" in { check((a: ByteString, b: ByteString) (a ++ b).takeRight(b.size) == b) }
"droppnig then taking" in { check((a: ByteString, b: ByteString) (b ++ a ++ b).drop(b.size).take(a.size) == a) }
"dropping then taking" in { check((a: ByteString, b: ByteString) (b ++ a ++ b).drop(b.size).take(a.size) == a) }
"droppingRight" in { check((a: ByteString, b: ByteString) (b ++ a ++ b).drop(b.size).dropRight(b.size) == a) }
}