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 six such cases:
v3-core/contracts/libraries/TickBitmap.sol
Line 49 in d8b1c63
v3-core/contracts/libraries/SwapMath.sol
Line 87 in d8b1c63
v3-core/contracts/libraries/SwapMath.sol
Line 91 in d8b1c63
v3-core/contracts/libraries/Oracle.sol
Line 93 in d8b1c63
v3-core/contracts/libraries/Oracle.sol
Line 134 in d8b1c63
v3-core/contracts/libraries/Oracle.sol
Line 179 in d8b1c63
Replacing
with
can save gas fees and does not hurt readability.
The text was updated successfully, but these errors were encountered: