Commit 1d2d18f9 by Klaus Hott Vidal Committed by Francisco Giordano

Small gas improvement in SafeMath.sol (#811)

parent 82ce197e
...@@ -24,9 +24,9 @@ library SafeMath { ...@@ -24,9 +24,9 @@ library SafeMath {
*/ */
function div(uint256 a, uint256 b) internal pure returns (uint256) { function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0 // assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b; // uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold // assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c; return a / b;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment