Remove redundant reserve call (#674)

This commit is contained in:
Brad Dunbar
2024-03-04 09:04:40 +01:00
committed by GitHub
parent c5fae00c76
commit 7968f6f83d
2 changed files with 22 additions and 2 deletions
-2
View File
@@ -1283,9 +1283,7 @@ impl Extend<u8> for BytesMut {
// TODO: optimize
// 1. If self.kind() == KIND_VEC, use Vec::extend
// 2. Make `reserve` inline-able
for b in iter {
self.reserve(1);
self.put_u8(b);
}
}