Permalink
Browse files

Fix String::{Begins,Ends}With and with it a bunch of stuff

  • Loading branch information...
mniip committed May 3, 2018
1 parent 5ff8cef commit ecb41661f8c084c7ab924b77601ec29da7c2c50f
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/common/String.h
@@ -77,8 +77,8 @@ class ByteString : public std::basic_string<char>
inline bool Contains(value_type ch) const { return super::find(ch) != npos; }
inline bool Contains(ByteString const &other) { return super::find(other) != npos; }
inline bool BeginsWith(ByteString const &other) const { return super::compare(0, other.size(), other); }
inline bool EndsWith(ByteString const &other) const { return super::compare(size() - other.size(), other.size(), other); }
inline bool BeginsWith(ByteString const &other) const { return !super::compare(0, other.size(), other); }
inline bool EndsWith(ByteString const &other) const { return !super::compare(size() - other.size(), other.size(), other); }
using Split = SplitBase<ByteString>;
inline Split SplitBy(value_type ch, size_t pos = 0) const { return Split(*this, pos, super::find(ch, pos), 1, false); }
@@ -168,8 +168,8 @@ class String : public std::basic_string<char32_t>
inline bool Contains(value_type ch) const { return super::find(ch) != npos; }
inline bool Contains(String const &other) const { return super::find(other) != npos; }
inline bool BeginsWith(String const &other) const { return super::compare(0, other.size(), other); }
inline bool EndsWith(String const &other) const { return super::compare(size() - other.size(), other.size(), other); }
inline bool BeginsWith(String const &other) const { return !super::compare(0, other.size(), other); }
inline bool EndsWith(String const &other) const { return !super::compare(size() - other.size(), other.size(), other); }
using Split = SplitBase<String>;
inline Split SplitBy(value_type ch, size_t pos = 0) const { return Split(*this, pos, super::find(ch, pos), 1, false); }

0 comments on commit ecb4166

Please sign in to comment.