mirror of
https://github.com/mailscope/kumomta.git
synced 2026-09-08 19:48:57 +00:00
message: make retain_headers more efficient
Avoid an intermediate string allocation; we can write directly to the new buffer.
This commit is contained in:
@@ -651,7 +651,7 @@ impl Message {
|
||||
if !retain {
|
||||
continue;
|
||||
}
|
||||
new_data.extend_from_slice(hdr.to_header_string().as_bytes());
|
||||
hdr.write_header(&mut new_data)?;
|
||||
}
|
||||
new_data.extend_from_slice(b"\r\n");
|
||||
new_data.extend_from_slice(&data[body_offset..]);
|
||||
|
||||
Reference in New Issue
Block a user