1
0
mirror of https://github.com/samba-team/samba.git synced 2025-05-28 21:05:48 +03:00

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>
This commit is contained in:
Volker Lendecke 2024-02-19 13:15:55 +01:00
parent 01cbfab953
commit 97896fa7e5

View File

@ -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;
}