melib/imap: replace splice with truncate
Tests / Test on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (push) Successful in 10m56s
Details
Tests / Test on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (push) Successful in 10m56s
Details
splice() was calling memmove, it is a really inefficient way of truncating a string. Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>pull/314/head
parent
606f487fc5
commit
8a21be2177
|
@ -503,7 +503,7 @@ impl ImapStream {
|
|||
&& ret[last_line_idx..].starts_with(termination_string)
|
||||
{
|
||||
if !keep_termination_string {
|
||||
ret.splice(last_line_idx.., std::iter::empty::<u8>());
|
||||
ret.truncate(last_line_idx);
|
||||
}
|
||||
break;
|
||||
} else if termination_string.is_empty() {
|
||||
|
|
Loading…
Reference in New Issue