[ox/std] Fix String to StringView compare
This commit is contained in:
parent
6769bb63d9
commit
d571d49cce
14
deps/ox/src/ox/std/string.hpp
vendored
14
deps/ox/src/ox/std/string.hpp
vendored
@ -439,19 +439,7 @@ constexpr bool BasicString<SmallStringSize_v>::operator==(const char *other) con
|
||||
|
||||
template<std::size_t SmallStringSize_v>
|
||||
constexpr bool BasicString<SmallStringSize_v>::operator==(const OxString_c auto &other) const noexcept {
|
||||
if (len() != other.len()) {
|
||||
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;
|
||||
return ox::StringView(*this) == ox::StringView(other);
|
||||
}
|
||||
|
||||
template<std::size_t SmallStringSize_v>
|
||||
|
Loading…
Reference in New Issue
Block a user