Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2
diff options
context:
space:
mode:
authorMartin Hořeňovský2021-09-27 14:52:44 +0200
committerMartin Hořeňovský2021-09-27 14:55:28 +0200
commitd42e7a23a0ca942e73b7065a1fbf28b6b2a817ce (patch)
treedd25a53f6dbd98a36b2aaf1b1f3b4fa31e55df1c /src/catch2
parent7bb00a42be5195f30b10b944c275c746e446810c (diff)
downloadcatch3-d42e7a23a0ca942e73b7065a1fbf28b6b2a817ce.tar.gz
Change startsWith(char) to take StringRef as argument
Diffstat (limited to 'src/catch2')
-rw-r--r--src/catch2/internal/catch_string_manip.cpp2
-rw-r--r--src/catch2/internal/catch_string_manip.hpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/catch2/internal/catch_string_manip.cpp b/src/catch2/internal/catch_string_manip.cpp
index 0444cd38..b9d312e4 100644
--- a/src/catch2/internal/catch_string_manip.cpp
+++ b/src/catch2/internal/catch_string_manip.cpp
@@ -25,7 +25,7 @@ namespace Catch {
bool startsWith( std::string const& s, std::string const& prefix ) {
return s.size() >= prefix.size() && std::equal(prefix.begin(), prefix.end(), s.begin());
}
- bool startsWith( std::string const& s, char prefix ) {
+ bool startsWith( StringRef s, char prefix ) {
return !s.empty() && s[0] == prefix;
}
bool endsWith( std::string const& s, std::string const& suffix ) {
diff --git a/src/catch2/internal/catch_string_manip.hpp b/src/catch2/internal/catch_string_manip.hpp
index bd7d0ddf..605d898c 100644
--- a/src/catch2/internal/catch_string_manip.hpp
+++ b/src/catch2/internal/catch_string_manip.hpp
@@ -17,7 +17,7 @@
namespace Catch {
bool startsWith( std::string const& s, std::string const& prefix );
- bool startsWith( std::string const& s, char prefix );
+ bool startsWith( StringRef s, char prefix );
bool endsWith( std::string const& s, std::string const& suffix );
bool endsWith( std::string const& s, char suffix );
bool contains( std::string const& s, std::string const& infix );