mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-09 10:14:21 +01:00
Allocate vector with capacity in read_record()
...it's faster that way.
This commit is contained in:
@@ -257,7 +257,7 @@ pub fn read_record(payload: &[u8]) -> Result<Record> {
|
||||
assert!(header_size >= nr);
|
||||
header_size -= nr;
|
||||
}
|
||||
let mut values = Vec::new();
|
||||
let mut values = Vec::with_capacity(serial_types.len());
|
||||
for serial_type in serial_types {
|
||||
let (value, usize) = read_value(&payload[pos..], serial_type)?;
|
||||
pos += usize;
|
||||
|
||||
Reference in New Issue
Block a user