diff --git a/src/util.cc b/src/util.cc index bfa292a8..857a848e 100644 --- a/src/util.cc +++ b/src/util.cc @@ -66,16 +66,6 @@ const char DEFAULT_STRIP_CHARSET[] = "\r\n\t "; const char UPPER_XDIGITS[] = "0123456789ABCDEF"; -bool isAlpha(const char c) { - return ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z'); -} - -bool isDigit(const char c) { return '0' <= c && c <= '9'; } - -bool isHexDigit(const char c) { - return isDigit(c) || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f'); -} - bool inRFC3986UnreservedChars(const char c) { static const char unreserved[] = {'-', '.', '_', '~'}; return isAlpha(c) || isDigit(c) || diff --git a/src/util.h b/src/util.h index 6ca9f735..7524a247 100644 --- a/src/util.h +++ b/src/util.h @@ -158,11 +158,15 @@ std::string joinPath(InputIterator first, InputIterator last) { return strjoin(elements.begin(), elements.end(), "/"); } -bool isAlpha(const char c); +inline bool isAlpha(const char c) { + return ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z'); +} -bool isDigit(const char c); +inline bool isDigit(const char c) { return '0' <= c && c <= '9'; } -bool isHexDigit(const char c); +inline bool isHexDigit(const char c) { + return isDigit(c) || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f'); +} bool inRFC3986UnreservedChars(const char c);