From 2c92ce8a60300e1bcdb1a651a572e1b002cc8637 Mon Sep 17 00:00:00 2001 From: Andreas <41449730+nonergodic@users.noreply.github.com> Date: Wed, 18 Dec 2024 13:14:09 -0800 Subject: [PATCH] Update docs/Optimization.md Co-authored-by: scnale --- docs/Optimization.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Optimization.md b/docs/Optimization.md index df51ef8..6a02ebf 100644 --- a/docs/Optimization.md +++ b/docs/Optimization.md @@ -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: