From f1e92dd184a599f39ce9cc4ec8a5e4a94416f3a2 Mon Sep 17 00:00:00 2001 From: busypeter Date: Mon, 3 May 2021 21:50:07 +0200 Subject: [PATCH] Fix code comments (#2658) --- contracts/utils/math/Math.sol | 2 +- contracts/utils/math/SafeMath.sol | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/contracts/utils/math/Math.sol b/contracts/utils/math/Math.sol index 414da4b00..e7023c40c 100644 --- a/contracts/utils/math/Math.sol +++ b/contracts/utils/math/Math.sol @@ -25,7 +25,7 @@ library Math { * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { - // (a + b) / 2 can overflow, so we distribute + // (a + b) / 2 can overflow, so we distribute. return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); } } diff --git a/contracts/utils/math/SafeMath.sol b/contracts/utils/math/SafeMath.sol index af8f9e854..de7084968 100644 --- a/contracts/utils/math/SafeMath.sol +++ b/contracts/utils/math/SafeMath.sol @@ -175,10 +175,6 @@ library SafeMath { * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * - * Counterpart to Solidity's `%` operator. This function uses a `revert` - * opcode (which leaves remaining gas untouched) while Solidity uses an - * invalid opcode to revert (consuming all remaining gas). - * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas).