mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-09 06:15:19 +00:00
acpi_tables: aml: Avoid allocating temporary vector in Interrupt
Use extend_from_slice() vs creating a temporary vector. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
242a7f7ab4
commit
ef216c37df
@ -533,14 +533,14 @@ impl Interrupt {
|
||||
impl Aml for Interrupt {
|
||||
fn append_aml_bytes(&self, bytes: &mut Vec<u8>) {
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user