From feaaa595cae735bb6093b24a88562c27b2723cfe Mon Sep 17 00:00:00 2001 From: Treeston Date: Thu, 10 Sep 2020 15:19:17 +0200 Subject: Core/ChatCommands: make ExactSequence more readable --- src/common/Utilities/Util.cpp | 5 ----- src/common/Utilities/Util.h | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'src/common') diff --git a/src/common/Utilities/Util.cpp b/src/common/Utilities/Util.cpp index b6066e9505b..c51cb954c91 100644 --- a/src/common/Utilities/Util.cpp +++ b/src/common/Utilities/Util.cpp @@ -655,11 +655,6 @@ bool StringEqualI(std::string_view str1, std::string_view str2) }); } -bool StringStartsWith(std::string_view haystack, std::string_view needle) -{ - return (haystack.substr(0, needle.length()) == needle); -} - bool StringContainsStringI(std::string_view haystack, std::string_view needle) { return haystack.end() != diff --git a/src/common/Utilities/Util.h b/src/common/Utilities/Util.h index a355d1af6d3..170fbbd52d9 100644 --- a/src/common/Utilities/Util.h +++ b/src/common/Utilities/Util.h @@ -331,7 +331,8 @@ inline std::vector HexStrToByteVector(std::string_view str, bool reverse } TC_COMMON_API bool StringEqualI(std::string_view str1, std::string_view str2); -TC_COMMON_API bool StringStartsWith(std::string_view haystack, std::string_view needle); +inline bool StringStartsWith(std::string_view haystack, std::string_view needle) { return (haystack.substr(0, needle.length()) == needle); } +inline bool StringStartsWithI(std::string_view haystack, std::string_view needle) { return StringEqualI(haystack.substr(0, needle.length()), needle); } TC_COMMON_API bool StringContainsStringI(std::string_view haystack, std::string_view needle); template inline bool ValueContainsStringI(std::pair const& haystack, std::string_view needle) -- cgit v1.2.3