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:
parent
73284fd897
commit
034f6c5c96
2 changed files with 1 additions and 2 deletions
|
|
@ -330,7 +330,6 @@ object ByteString {
|
|||
val copyLength = Math.min(buffer.remaining, length)
|
||||
if (copyLength > 0) {
|
||||
buffer.put(bytes, startIndex, copyLength)
|
||||
drop(copyLength)
|
||||
}
|
||||
copyLength
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue