Skip to content

Commit

Permalink
fast_strtoull_hex() remove 2 unnecessary operations
Browse files Browse the repository at this point in the history
Both GCC and Clang can find them as unnecessary and optimize out.
  • Loading branch information
Explorer09 committed Mar 23, 2024
1 parent b9a075a commit 120b7f4
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions linux/LinuxProcessTable.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ static inline uint64_t fast_strtoull_hex(char** str, int maxlen) {
if ((nibble < '0') || (nibble & ~0x20) > 'F')
break;
letter = (nibble & 0x40) ? 'A' - '9' - 1 : 0;
nibble &=~0x20; // to upper
nibble ^= 0x10; // switch letters and digits
nibble -= letter;
nibble &= 0x0f;
result <<= 4;
Expand Down

0 comments on commit 120b7f4

Please sign in to comment.