Skip to content

Commit

Permalink
Fix operator unlimited recursive calls
Browse files Browse the repository at this point in the history
  • Loading branch information
intelligide committed Feb 26, 2021
1 parent 3514052 commit cb22171
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions crnlib/crn_hash_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -439,15 +439,15 @@ namespace crnlib
}
inline bool operator!=(const const_iterator& b) const
{
return *this != b;
return !(*this == b);
}
inline bool operator==(const iterator& b) const
{
return (m_pTable == b.m_pTable) && (m_index == b.m_index);
}
inline bool operator!=(const iterator& b) const
{
return *this != b;
return !(*this == b);
}

private:
Expand Down
6 changes: 3 additions & 3 deletions crnlib/crn_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ namespace crnlib
{
friend bool operator!=(const T& x, const T& y)
{
return x != y;
return (!(x == y));
}
friend bool operator>(const T& x, const T& y)
{
return (y < x);
}
friend bool operator<=(const T& x, const T& y)
{
return y >= x;
return (!(y < x));
}
friend bool operator>=(const T& x, const T& y)
{
return x >= y;
return (!(x < y));
}
};

Expand Down

0 comments on commit cb22171

Please sign in to comment.