Minor bug fixs for find and replace, more tests

This commit is contained in:
Krystian Stasiowski
2019-10-29 17:29:55 -04:00
parent 193439e3ef
commit 7a0a720a42
3 changed files with 1652 additions and 270 deletions

View File

@ -1832,7 +1832,8 @@ public:
starts_with(
string_view_type s) const noexcept
{
return starts_with(s.data());
const size_type len = s.size();
return n_ >= len && !Traits::compare(s_, s.data(), len);
}
bool
@ -1854,7 +1855,8 @@ public:
ends_with(
string_view_type s) const noexcept
{
return ends_with(s.data());
const size_type len = s.size();
return n_ >= len && !Traits::compare(s_ + (n_ - len), s.data(), len);
}
bool