From ef216c37df055edf1f1992c63df7f835a2e45425 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 Interrupt Use extend_from_slice() vs creating a temporary vector. Signed-off-by: Rob Bradford --- acpi_tables/src/aml.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/acpi_tables/src/aml.rs b/acpi_tables/src/aml.rs index 21402081c..15d196706 100644 --- a/acpi_tables/src/aml.rs +++ b/acpi_tables/src/aml.rs @@ -533,14 +533,14 @@ impl Interrupt { impl Aml for Interrupt { fn append_aml_bytes(&self, bytes: &mut Vec) { bytes.push(0x89); /* Extended IRQ Descriptor */ - bytes.append(&mut 6u16.to_le_bytes().to_vec()); + bytes.extend_from_slice(&6u16.to_le_bytes()); let flags = (self.shared as u8) << 3 | (self.active_low as u8) << 2 | (self.edge_triggered as u8) << 1 | self.consumer as u8; bytes.push(flags); bytes.push(1u8); /* count */ - bytes.append(&mut self.number.to_le_bytes().to_vec()); + bytes.extend_from_slice(&self.number.to_le_bytes()); } }