mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-01-29 04:27:50 +01:00
Fix EndsWidth crash when the suffix is longer than *this
This commit is contained in:
parent
5928125594
commit
07fa908102
@ -244,7 +244,7 @@ public:
|
||||
inline bool Contains(ByteString const &other) const { 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 EndsWith(ByteString const &other) const { return size() >= other.size() && !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); }
|
||||
@ -417,7 +417,7 @@ public:
|
||||
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 EndsWith(String const &other) const { return size() >= other.size() && !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); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user