diff options
| author | Martin Hořeňovský | 2017-01-15 10:06:18 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2017-01-25 22:39:43 +0100 |
| commit | 83f4b39680784e7ac6d8fd71ac8bc9541541385f (patch) | |
| tree | 38d887965865bab80105855832aadfcbed30cda3 /include | |
| parent | 3b98a0166f7b7196eba2ad518174d1a77165166d (diff) | |
| download | catch3-83f4b39680784e7ac6d8fd71ac8bc9541541385f.tar.gz | |
Added benchmark for previous commit, added iterations to failure bench.
Diffstat (limited to 'include')
| -rw-r--r-- | include/internal/catch_common.hpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/include/internal/catch_common.hpp b/include/internal/catch_common.hpp index f4006c72..2af51a12 100644 --- a/include/internal/catch_common.hpp +++ b/include/internal/catch_common.hpp @@ -10,21 +10,19 @@ #include "catch_common.h" -#include <algorithm> - 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 ) { - return !s.empty() && s.front() == prefix; + return !s.empty() && s[0] == prefix; } bool endsWith( std::string const& s, std::string const& suffix ) { return s.size() >= suffix.size() && std::equal(suffix.rbegin(), suffix.rend(), s.rbegin()); } bool endsWith( std::string const& s, char suffix ) { - return !s.empty() && s.back() == suffix; + return !s.empty() && s[s.size()-1] == suffix; } bool contains( std::string const& s, std::string const& infix ) { return s.find( infix ) != std::string::npos; |