diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-06 17:03:50 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-06 17:07:12 +0000 |
| commit | 596643a0d5cfd4c5ed236a04dd0e95aacd910d78 (patch) | |
| tree | 0b8b0ee8b641e88879f263dc0a1e97243b6c1962 /include/chromebook.sh | |
| parent | 6023d17b6e37d0b95680c55aea85c48973e0cace (diff) | |
util/nvmutil: optimise hextonum
there is 0x20 of different between a and A
so we can just or 0x20 and compare only lowercase.
we can also cast char (which may me signed on some
systems) to unsigned, and then only check whether
it's lower than 10.
this code results in far less branching (in C),
but a good optimising compiler probably wouldn't
have cared about the old version anyway.
it's just nicer C code.
this also means we no longer need to check for
X, only x.
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/chromebook.sh')
0 files changed, 0 insertions, 0 deletions
