Skip to content

Commit bc37a09

Browse files
aerosouundJackThomson2
authored andcommitted
remove redunant todo regarding mac address init
the from_bytes_unchecked function copies 6 bytes into a new slice of bytes that is then used as the mac address. the comment highlighted that the second array memory initialization should be removed somehow, but the compiler already optimized it away Signed-off-by: aerosouund <[email protected]>
1 parent 89702a7 commit bc37a09

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

src/vmm/src/utils/net/mac.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ impl MacAddr {
8484
/// * `src` - slice from which to copy MAC address content.
8585
#[inline]
8686
pub fn from_bytes_unchecked(src: &[u8]) -> MacAddr {
87-
// TODO: using something like std::mem::uninitialized could avoid the extra initialization,
88-
// if this ever becomes a performance bottleneck.
8987
let mut bytes = [0u8; MAC_ADDR_LEN as usize];
9088
bytes[..].copy_from_slice(src);
9189

0 commit comments

Comments
 (0)