no reallocation
This commit is contained in:
parent
e731bbd0fb
commit
b0f00f4d87
1 changed files with 1 additions and 2 deletions
|
|
@ -34,8 +34,7 @@ impl Into<Vec<u8>> for Record{
|
|||
let mut length_bytes = varint::write(record_length as u64);
|
||||
let mut rowid_bytes = varint::write(self.rowid);
|
||||
|
||||
// let mut buffer = Vec::with_capacity(length_bytes.len() + rowid_bytes.len() + record_length);
|
||||
let mut buffer = Vec::new();
|
||||
let mut buffer = Vec::with_capacity(length_bytes.len() + rowid_bytes.len() + record_length as usize);
|
||||
buffer.append(&mut length_bytes);
|
||||
buffer.append(&mut rowid_bytes);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue