From 99d4f77197f287be570c009e27f94765198a6b6c 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 Memory32Fixed Use extend_from_slice() vs creating a temporary vector. Signed-off-by: Rob Bradford --- acpi_tables/src/aml.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/acpi_tables/src/aml.rs b/acpi_tables/src/aml.rs index 666115c9f..bdd1c3762 100644 --- a/acpi_tables/src/aml.rs +++ b/acpi_tables/src/aml.rs @@ -356,11 +356,11 @@ impl Memory32Fixed { impl Aml for Memory32Fixed { fn append_aml_bytes(&self, bytes: &mut Vec) { bytes.push(0x86); /* Memory32Fixed */ - bytes.append(&mut 9u16.to_le_bytes().to_vec()); + bytes.extend_from_slice(&9u16.to_le_bytes()); // 9 bytes of payload bytes.push(self.read_write as u8); - bytes.append(&mut self.base.to_le_bytes().to_vec()); - bytes.append(&mut self.length.to_le_bytes().to_vec()); + bytes.extend_from_slice(&self.base.to_le_bytes()); + bytes.extend_from_slice(&self.length.to_le_bytes()); } }