diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-01-31 22:45:19 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-01-31 22:45:19 +0300 |
commit | e4527d501cf73ef545894dfba5cc763d9476759d (patch) | |
tree | fa361d358c5b1ce713d5af7d67914d8b2df8fd75 /src/utils/stringutils.h | |
parent | 4ec9d3a629305e72d8dc81006080a2622bb90a32 (diff) | |
download | mv-e4527d501cf73ef545894dfba5cc763d9476759d.tar.gz mv-e4527d501cf73ef545894dfba5cc763d9476759d.tar.bz2 mv-e4527d501cf73ef545894dfba5cc763d9476759d.tar.xz mv-e4527d501cf73ef545894dfba5cc763d9476759d.zip |
Convert function isWordSeparator into constexpr function.
Diffstat (limited to 'src/utils/stringutils.h')
-rw-r--r-- | src/utils/stringutils.h | 9 |
1 files changed, 8 insertions, 1 deletions
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; |