This commit is contained in:
test123456654321 2024-10-27 23:51:02 +08:00
parent 7f8db4c417
commit bf0f8877b5

View File

@ -51,7 +51,7 @@ inline std::vector<StringT> strSplit_impl(const StringT &s, const StringT &delim
template <class StringT>
inline bool endWith_impl(const StringT &s, const StringT &s2)
{
if (s2.size() && (s.size() >= s2.size()) && (s.substr(s.size() - s2.size(), s2.size()) == s2))
if ((s.size() >= s2.size()) && (s.substr(s.size() - s2.size(), s2.size()) == s2))
{
return true;
}
@ -61,7 +61,7 @@ inline bool endWith_impl(const StringT &s, const StringT &s2)
template <class StringT>
inline bool startWith_impl(const StringT &s, const StringT &s2)
{
if (s2.size() && (s.size() >= s2.size()) && (s.substr(0, s2.size()) == s2))
if ((s.size() >= s2.size()) && (s.substr(0, s2.size()) == s2))
{
return true;
}