wstr: Use `extend_from_slice` instead of manually pushing to output.

This commit is contained in:
EmperorBale 2022-07-24 22:31:12 -07:00 committed by Mike Welsh
parent 026fcfff62
commit dde2895f98
1 changed files with 1 additions and 2 deletions

View File

@ -176,6 +176,5 @@ pub fn encode_raw_utf16(mut ch: u32, dst: &mut Vec<u16>) {
let mut w2: u16 = 0xDC00;
w1 |= (ch >> 10) as u16;
w2 |= (ch & !(u32::MAX << 10)) as u16;
dst.push(w1);
dst.push(w2);
dst.extend_from_slice(&[w1, w2]);
}