Skip to content

Commit

Permalink
Optimise relational operators
Browse files Browse the repository at this point in the history
  • Loading branch information
itstrueitstrueitsrealitsreal committed Jan 28, 2025
1 parent 18a5cac commit af80174
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/operators/relational.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ bool BigInt::operator<(const BigInt& num) const {
*/

bool BigInt::operator>(const BigInt& num) const {
return !((*this < num) or (*this == num));
return num < *this;
}


Expand All @@ -69,7 +69,7 @@ bool BigInt::operator>(const BigInt& num) const {
*/

bool BigInt::operator<=(const BigInt& num) const {
return (*this < num) or (*this == num);
return !(*this > num);
}


Expand Down

0 comments on commit af80174

Please sign in to comment.