Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos committed Jul 10, 2023
1 parent 473c934 commit e39bd60
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frozen/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ template <typename _CharT> class basic_string {
constexpr chr_t operator[](std::size_t i) const { return data_[i]; }

constexpr bool operator==(basic_string other) const {
return std::memcmp(data_, other.data_, size_) == 0;
if (size_ != other.size_)
return false;
for (std::size_t i = 0; i < size_; ++i)
if (data_[i] != other.data_[i])
return false;
return true;
}

constexpr bool operator<(const basic_string &other) const {
Expand Down

0 comments on commit e39bd60

Please sign in to comment.