Skip to content

Commit 720f4d5

Browse files
committed
remove additional operation from Math#average function
1 parent 91a6bbf commit 720f4d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contracts/utils/Math.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ library Math {
1111
*/
1212
function average(uint256 a, uint256 b) internal pure returns (uint256) {
1313
unchecked {
14-
return (a >> 1) + (b >> 1) + ((a & 1) & (b & 1));
14+
return (a >> 1) + (b >> 1) + (a & b & 1);
1515
}
1616
}
1717

0 commit comments

Comments
 (0)