diff --git a/deps/ox/src/ox/std/bstring.hpp b/deps/ox/src/ox/std/bstring.hpp index 8d1f8cbe..7997ba8f 100644 --- a/deps/ox/src/ox/std/bstring.hpp +++ b/deps/ox/src/ox/std/bstring.hpp @@ -111,7 +111,7 @@ constexpr BString &BString::operator=(const char *str) noexcept { } ox_memcpy(m_buff, str, strLen); // make sure last element is a null terminator - m_buff[cap() - 1] = 0; + m_buff[cap()] = 0; return *this; } @@ -168,16 +168,7 @@ constexpr BString BString::operator+(Integer_c auto i) const noexcep template constexpr bool BString::operator==(const BString &other) const noexcept { - bool retval = true; - std::size_t i = 0; - while (i < buffLen && (m_buff[i] || other.m_buff[i])) { - if (m_buff[i] != other.m_buff[i]) { - retval = false; - break; - } - i++; - } - return retval; + return ox::StringView(*this) == ox::StringView(other); } template