Skip to content

Commit cb22171

Browse files
committed
Fix operator unlimited recursive calls
1 parent 3514052 commit cb22171

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

crnlib/crn_hash_map.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,15 +439,15 @@ namespace crnlib
439439
}
440440
inline bool operator!=(const const_iterator& b) const
441441
{
442-
return *this != b;
442+
return !(*this == b);
443443
}
444444
inline bool operator==(const iterator& b) const
445445
{
446446
return (m_pTable == b.m_pTable) && (m_index == b.m_index);
447447
}
448448
inline bool operator!=(const iterator& b) const
449449
{
450-
return *this != b;
450+
return !(*this == b);
451451
}
452452

453453
private:

crnlib/crn_helpers.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ namespace crnlib
4040
{
4141
friend bool operator!=(const T& x, const T& y)
4242
{
43-
return x != y;
43+
return (!(x == y));
4444
}
4545
friend bool operator>(const T& x, const T& y)
4646
{
4747
return (y < x);
4848
}
4949
friend bool operator<=(const T& x, const T& y)
5050
{
51-
return y >= x;
51+
return (!(y < x));
5252
}
5353
friend bool operator>=(const T& x, const T& y)
5454
{
55-
return x >= y;
55+
return (!(x < y));
5656
}
5757
};
5858

0 commit comments

Comments
 (0)