acpi_tables: aml: Avoid allocating temporary vector in Io

Use extend_from_slice() vs creating a temporary vector.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2021-11-03 15:08:15 +00:00
parent 7ad83f1daa
commit eec7634cd7

View File

@ -496,10 +496,9 @@ impl Io {
impl Aml for Io {
fn append_aml_bytes(&self, bytes: &mut Vec<u8>) {
bytes.push(0x47); /* Io Port Descriptor */
bytes.push(1); /* IODecode16 */
bytes.append(&mut self.min.to_le_bytes().to_vec());
bytes.append(&mut self.max.to_le_bytes().to_vec());
bytes.extend_from_slice(&self.min.to_le_bytes());
bytes.extend_from_slice(&self.max.to_le_bytes());
bytes.push(self.alignment);
bytes.push(self.length);
}