From 02c4512b001d64cb06d7fb7e4e4c2192911a5968 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 21 Dec 2023 17:36:42 +0100 Subject: [PATCH] util/CharUtil: add IsLowerHexDigit() --- src/util/CharUtil.hxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/util/CharUtil.hxx b/src/util/CharUtil.hxx index 44fd9b3a7..3f111b3ac 100644 --- a/src/util/CharUtil.hxx +++ b/src/util/CharUtil.hxx @@ -133,9 +133,15 @@ ToLowerASCII(char ch) noexcept } constexpr bool -IsHexDigit(char ch) noexcept +IsLowerHexDigit(char ch) noexcept { return IsDigitASCII(ch) || - (ch >= 'a' && ch <= 'f') || + (ch >= 'a' && ch <= 'f'); +} + +constexpr bool +IsHexDigit(char ch) noexcept +{ + return IsLowerHexDigit(ch) || (ch >= 'A' && ch <= 'F'); }