diff options
| author | Volker Lendecke <vl@samba.org> | 2024-02-19 13:15:55 +0100 |
|---|---|---|
| committer | Volker Lendecke <vl@samba.org> | 2024-03-12 13:31:31 +0000 |
| commit | 97896fa7e54039b0a56510f9ccd22e71fb42b42c (patch) | |
| tree | 657953fe74b4fe7723fd3ad8eb54c23494e1919b /lib/replace/replace.h | |
| parent | 01cbfab953807b5231a255f69294d39a67a76ce9 (diff) | |
| download | samba-97896fa7e54039b0a56510f9ccd22e71fb42b42c.tar.gz samba-97896fa7e54039b0a56510f9ccd22e71fb42b42c.tar.bz2 samba-97896fa7e54039b0a56510f9ccd22e71fb42b42c.zip | |
lib: Simplify _hexcharval
Saves a few bytes and conditional jumps
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib/replace/replace.h')
| -rw-r--r-- | lib/replace/replace.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/replace/replace.h b/lib/replace/replace.h index a6a2b40777f..537e61e1e48 100644 --- a/lib/replace/replace.h +++ b/lib/replace/replace.h @@ -1079,7 +1079,7 @@ static inline bool uid_wrapper_enabled(void) static inline bool _hexcharval(char c, uint8_t *val) { if ((c >= '0') && (c <= '9')) { *val = c - '0'; return true; } - if ((c >= 'a') && (c <= 'f')) { *val = c - 'a' + 10; return true; } + c &= 0xDF; /* map lower to upper case -- thanks libnfs :-) */ if ((c >= 'A') && (c <= 'F')) { *val = c - 'A' + 10; return true; } return false; } |
