Skip to content
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

flash/op: add String() and Bytes() for OpCode #2847

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

rminnich
Copy link
Member

I decided not to use a map.

Using a switch lets the compiler optimize at it sees fit, where a map wires in a decision as to best implementation, a map sitting around we almost never need, and so on. I'm sensitive to this in a world of little devices.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
@rminnich
Copy link
Member Author

just as one example, many compilers can generate very efficient code given a switch. It pays to give the compiler the option. But, given a map, the compiler has little choice but to do what you say.

Copy link

codecov bot commented Jan 11, 2024

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (02dfe97) 75.71% compared to head (ba1a421) 75.72%.

Files Patch % Lines
pkg/flash/flash_linux.go 33.33% 6 Missing ⚠️
pkg/flash/op/op.go 93.75% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2847      +/-   ##
==========================================
+ Coverage   75.71%   75.72%   +0.01%     
==========================================
  Files         423      424       +1     
  Lines       42769    42801      +32     
==========================================
+ Hits        32382    32413      +31     
- Misses      10387    10388       +1     
Flag Coverage Δ
.-amd64 67.87% <ø> (ø)
cmds/...-amd64 71.73% <100.00%> (+0.01%) ⬆️
integration/generic-tests/...-amd64 0.00% <ø> (ø)
integration/generic-tests/...-arm 0.00% <ø> (ø)
integration/generic-tests/...-arm64 0.00% <ø> (ø)
integration/gotests/...-amd64 73.99% <80.48%> (+0.01%) ⬆️
integration/gotests/...-arm64 74.92% <80.48%> (+0.01%) ⬆️
pkg/...-amd64 76.13% <80.95%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rminnich rminnich merged commit 4046fb0 into u-root:main Jan 11, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants