Skip to content

Commit

Permalink
Replace strict inequality by non-strict inequality to save gas
Browse files Browse the repository at this point in the history
  • Loading branch information
Zahnentferner committed Apr 11, 2023
1 parent 6d9b8dd commit 44aef84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Aggr3Oracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ contract Aggr3Oracle is MultiOwnable {
}

function median3(uint256 a, uint256 b, uint256 c) internal pure returns (uint256) {
if (a > b) {
if (a >= b) {
if (c >= a) return a;
else if (b >= c) return b;
else return c;
}
else { // b >= a
else { // b > a
if (c >= b) return b;
else if (a >= c) return a;
else return c;
Expand Down

0 comments on commit 44aef84

Please sign in to comment.