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

@ -330,7 +330,6 @@ object ByteString {
val copyLength = Math.min(buffer.remaining, length)
if (copyLength > 0) {
buffer.put(bytes, startIndex, copyLength)
drop(copyLength)
}
copyLength
}