From d571d49ccea0d8a4831e5518c9d13b7ae65c50d3 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Tue, 7 Feb 2023 01:30:59 -0600 Subject: [PATCH] [ox/std] Fix String to StringView compare --- deps/ox/src/ox/std/string.hpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/deps/ox/src/ox/std/string.hpp b/deps/ox/src/ox/std/string.hpp index 664147ac..8619fe3c 100644 --- a/deps/ox/src/ox/std/string.hpp +++ b/deps/ox/src/ox/std/string.hpp @@ -439,19 +439,7 @@ constexpr bool BasicString::operator==(const char *other) con template constexpr bool BasicString::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