You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The solidity compiler generates more code for “if (A && B) {}” than for “if (A) {if (B) {} }”.
Our experiment shows that switching from “if (A && B) {}” to “if (A) {if (B) {} }” can save gas fees.
The solidity compiler generates more code for “if (A && B) {}” than for “if (A) {if (B) {} }”.
Our experiment shows that switching from “if (A && B) {}” to “if (A) {if (B) {} }” can save gas fees.
There are two such cases:
v2-periphery/contracts/UniswapV2Router01.sol
Line 43 in 0335e8f
v2-periphery/contracts/UniswapV2Router02.sol
Line 46 in 0335e8f
Replacing
with
can save gas fees and does not hurt code readability.
The text was updated successfully, but these errors were encountered: