diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/utils/stringutils.cpp | 9 | ||||
-rw-r--r-- | src/utils/stringutils.h | 9 |
2 files changed, 8 insertions, 10 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index 6ec7817ed..0cece6d0a 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -154,15 +154,6 @@ int compareStrI(const std::string &a, const std::string &b) return 1; } - -bool isWordSeparator(const signed char chr) -{ - return chr == ' ' || - chr == ',' || - chr == '.' || - chr == '"'; -} - const std::string findSameSubstring(const std::string &restrict str1, const std::string &restrict str2) { diff --git a/src/utils/stringutils.h b/src/utils/stringutils.h index abcbc6b07..cb4bbb332 100644 --- a/src/utils/stringutils.h +++ b/src/utils/stringutils.h @@ -136,7 +136,14 @@ int compareStrI(const std::string &a, const std::string &b) A_WARN_UNUSED; /** * Tells wether the character is a word separator. */ -bool isWordSeparator(const signed char chr) A_CONST A_WARN_UNUSED; +constexpr bool isWordSeparator(const signed char chr) A_CONST A_WARN_UNUSED; +constexpr bool isWordSeparator(const signed char chr) +{ + return chr == ' ' || + chr == ',' || + chr == '.' || + chr == '"'; +} size_t findI(std::string str, std::string subStr) A_WARN_UNUSED; |