From eec7634cd7e1247433c4e62024807845b741cc47 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Wed, 3 Nov 2021 15:08:15 +0000 Subject: [PATCH] acpi_tables: aml: Avoid allocating temporary vector in Io Use extend_from_slice() vs creating a temporary vector. Signed-off-by: Rob Bradford --- acpi_tables/src/aml.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/acpi_tables/src/aml.rs b/acpi_tables/src/aml.rs index 90588440a..cba4f8b4b 100644 --- a/acpi_tables/src/aml.rs +++ b/acpi_tables/src/aml.rs @@ -496,10 +496,9 @@ impl Io { impl Aml for Io { fn append_aml_bytes(&self, bytes: &mut Vec) { 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); }