mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-22 03:12:27 +00:00
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:
parent
7ad83f1daa
commit
eec7634cd7
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user