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 fee.
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 fee.
There are five such cases:
v3-periphery/contracts/base/PeripheryPayments.sol
Line 58 in 6cce88e
Replacing
with
can save gas fees and does not hurt code readability.
Similarly, the following code snippets can be improved:
v3-periphery/contracts/libraries/NFTDescriptor.sol
Line 224 in 6cce88e
v3-periphery/contracts/libraries/NFTDescriptor.sol
Line 277 in 6cce88e
v3-periphery/contracts/V3Migrator.sol
Line 78 in 6cce88e
v3-periphery/contracts/V3Migrator.sol
Line 91 in 6cce88e
The text was updated successfully, but these errors were encountered: