-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Remove TODO in from_bytes_unchecked mac address builder #5607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove TODO in from_bytes_unchecked mac address builder #5607
Conversation
|
I had a quick look in godbolt, it's not apples to apples comparison, but it looks like the compiler was already eliminating this array initialisation: link here The only difference being the range check which was skipped. I think we can just remove this TODO as it doesn't seem relevant anymore. Thanks for taking a look! |
|
@JackThomson2 |
|
@aerosouund Great thank you! Can we just have this as a single commit now then looks good to me. |
c09baa3 to
ae39e9a
Compare
|
Can we update the commit message to have a shorter title and a small body explaining the change. There's a helpful bit in the contribution guidelines here: https://github.com/firecracker-microvm/firecracker/blob/main/CONTRIBUTING.md#contribution-quality-standards |
ae39e9a to
bd63590
Compare
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]>
bd63590 to
9803b24
Compare
|
@JackThomson2 |
|
Looks great thank you |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5607 +/- ##
=======================================
Coverage 83.23% 83.23%
=======================================
Files 277 277
Lines 29262 29262
=======================================
Hits 24357 24357
Misses 4905 4905
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Changes
Remove the TODO in the
from_bytes_uncheckedthat concerns the second array initialization during mac address building as the compiler already optimizes it awayReason
This was an unaddressed todo
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.PR Checklist
tools/devtool checkbuild --allto verify that the PR passesbuild checks on all supported architectures.
tools/devtool checkstyleto verify that the PR passes theautomated style checks.
how they are solving the problem in a clear and encompassing way.
in the PR.
CHANGELOG.md.Runbook for Firecracker API changes.
integration tests.
TODO.rust-vmm.