[ox/std] Fix String to StringView compare

This commit is contained in:
Gary Talent 2023-02-07 01:30:59 -06:00
parent 6769bb63d9
commit d571d49cce

View File

@ -439,19 +439,7 @@ constexpr bool BasicString<SmallStringSize_v>::operator==(const char *other) con
template<std::size_t SmallStringSize_v> template<std::size_t SmallStringSize_v>
constexpr bool BasicString<SmallStringSize_v>::operator==(const OxString_c auto &other) const noexcept { constexpr bool BasicString<SmallStringSize_v>::operator==(const OxString_c auto &other) const noexcept {
if (len() != other.len()) { return ox::StringView(*this) == ox::StringView(other);
return false;
}
bool retval = true;
std::size_t i = 0;
while (i < m_buff.size() && (m_buff[i] || other[i])) {
if (m_buff[i] != other[i]) {
retval = false;
break;
}
i++;
}
return retval;
} }
template<std::size_t SmallStringSize_v> template<std::size_t SmallStringSize_v>