Skip to content

Commit f488be4

Browse files
authored
Revert "Reuse capacity when possible in <BytesMut as Buf>::advance impl" (#726)
This reverts commit baa5053.
1 parent 03fdde9 commit f488be4

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

src/bytes_mut.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,13 +1148,6 @@ impl Buf for BytesMut {
11481148

11491149
#[inline]
11501150
fn advance(&mut self, cnt: usize) {
1151-
// Advancing by the length is the same as resetting the length to 0,
1152-
// except this way we get to reuse the full capacity.
1153-
if cnt == self.remaining() {
1154-
self.clear();
1155-
return;
1156-
}
1157-
11581151
assert!(
11591152
cnt <= self.remaining(),
11601153
"cannot advance past `remaining`: {:?} <= {:?}",

0 commit comments

Comments
 (0)