mirror of
https://github.com/samba-team/samba.git
synced 2025-05-30 01:05:50 +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:
parent
01cbfab953
commit
97896fa7e5
@ -1079,7 +1079,7 @@ static inline bool uid_wrapper_enabled(void)
|
|||||||
static inline bool _hexcharval(char c, uint8_t *val)
|
static inline bool _hexcharval(char c, uint8_t *val)
|
||||||
{
|
{
|
||||||
if ((c >= '0') && (c <= '9')) { *val = c - '0'; return true; }
|
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; }
|
if ((c >= 'A') && (c <= 'F')) { *val = c - 'A' + 10; return true; }
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user