Skip to content

Commit

Permalink
refactor(imt.sol): update the way depth is increased to optimize gas
Browse files Browse the repository at this point in the history
  • Loading branch information
vplasencia committed Mar 20, 2024
1 parent a41477c commit 22b6a12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/imt.sol/contracts/internal/InternalLeanIMT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ library InternalLeanIMT {
// Unlike the 'insert' function, we need a while here as
// N insertions can increase the tree's depth more than once.
while (2 ** self.depth < treeSize + leaves.length) {
self.depth += 1;
++self.depth;
}

// First index to change in every level.
Expand Down

0 comments on commit 22b6a12

Please sign in to comment.