diff --git a/BAN/include/BAN/StringView.h b/BAN/include/BAN/StringView.h index 40f8d8500c..2fe5c90749 100644 --- a/BAN/include/BAN/StringView.h +++ b/BAN/include/BAN/StringView.h @@ -186,15 +186,10 @@ namespace BAN { if (target.size() > m_size) return false; - for (size_type i = 0; i < m_size - target.size(); i++) - { - bool valid = true; - for (size_type j = 0; j < target.size() && valid; j++) - valid = (m_data[i + j] == target[j]); - if (valid) - return true; - } - return false; + for (size_type i = 0; i < target.size(); i++) + if (m_data[i] != target[i]) + return false; + return true; } constexpr bool contains(char ch) const