diff --git a/src/unicode.cpp b/src/unicode.cpp index c6100dd0f..b3f6d75cf 100644 --- a/src/unicode.cpp +++ b/src/unicode.cpp @@ -373,8 +373,8 @@ unsigned constexpr convert_hex_to_binary(const char c) noexcept { if (c <= '9') { return c - '0'; } - char del = c >= 'a' ? 'a' : 'A'; - return 10 + (c - del); + char del = (c >= 'a' ? 'a' : 'A') - 10; + return c - del; } std::string percent_decode(const std::string_view input, size_t first_percent) {