Skip to content

Commit

Permalink
Update docs/Optimization.md
Browse files Browse the repository at this point in the history
Co-authored-by: scnale <[email protected]>
  • Loading branch information
nonergodic and scnale authored Dec 18, 2024
1 parent bd9f44e commit 2c92ce8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/Optimization.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ If `myArray` uses `calldata` instead of `memory`, both versions produce the same

Given that the EVM only supports `LT` and `GT` but not `LTE` or `GTE`, solc implements `x<=y` as `!(x>y)`. However, given a constant `MAX`, since solc resolves `MAX + 1` at compile time, `< MAX + 1` saves one `ISZERO` opcode.

## consider using `eagerAnd` and `eagerOr` over short-curcuiting `&&` and `||`
## consider using `eagerAnd` and `eagerOr` over short-circuiting `&&` and `||`

Short-circuiting `lhs && rhs` requires _at least_ the insertion of:

Expand Down

0 comments on commit 2c92ce8

Please sign in to comment.