Avoid string copying to speed up asan

This commit is contained in:
Henrik Hørlück Berg 2023-07-03 16:42:42 +02:00 committed by ridiculousfish
parent 595d593732
commit 970ed610df

View File

@ -338,7 +338,7 @@ fn escape_string_url(input: &wstr) -> WString {
} }
} }
// All other chars need to have their UTF-8 representation encoded in hex. // All other chars need to have their UTF-8 representation encoded in hex.
out += &sprintf!("%%%02X"L, byte)[..]; sprintf!(=> &mut out, "%%%02X"L, byte);
} }
out out
} }
@ -374,7 +374,7 @@ fn escape_string_var(input: &wstr) -> WString {
continue; continue;
} }
// All other chars need to have their UTF-8 representation encoded in hex. // All other chars need to have their UTF-8 representation encoded in hex.
out += &sprintf!("_%02X"L, byte)[..]; sprintf!(=> &mut out, "_%02X"L, byte);
prev_was_hex_encoded = true; prev_was_hex_encoded = true;
} }
if prev_was_hex_encoded { if prev_was_hex_encoded {