Skip to content

Commit

Permalink
Opt
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectorized committed Dec 17, 2024
1 parent ae6fdfe commit 2790f7c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/utils/LibClone.sol
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ library LibClone {
assembly {
args := mload(0x40)
let n := and(0xffffffffff, sub(extcodesize(instance), 0x2d))
let l := sub(n, mul(lt(shr(24, start), lt(start, n)), start))
let l := sub(n, and(0xffffff, mul(lt(start, n), start)))
extcodecopy(instance, add(args, 0x20), add(start, 0x2d), add(l, 0x20))
mstore(args, mul(sub(n, start), lt(start, n))) // Store the length.
mstore(0x40, add(args, add(0x40, mload(args)))) // Allocate memory.
Expand Down Expand Up @@ -1145,7 +1145,7 @@ library LibClone {
assembly {
args := mload(0x40)
let n := and(0xffffffffff, sub(extcodesize(instance), 0x3d))
let l := sub(n, mul(lt(shr(24, start), lt(start, n)), start))
let l := sub(n, and(0xffffff, mul(lt(start, n), start)))
extcodecopy(instance, add(args, 0x20), add(start, 0x3d), add(l, 0x20))
mstore(args, mul(sub(n, start), lt(start, n))) // Store the length.
mstore(0x40, add(args, add(0x40, mload(args)))) // Allocate memory.
Expand Down Expand Up @@ -1646,7 +1646,7 @@ library LibClone {
assembly {
args := mload(0x40)
let n := and(0xffffffffff, sub(extcodesize(instance), 0x52))
let l := sub(n, mul(lt(shr(24, start), lt(start, n)), start))
let l := sub(n, and(0xffffff, mul(lt(start, n), start)))
extcodecopy(instance, add(args, 0x20), add(start, 0x52), add(l, 0x20))
mstore(args, mul(sub(n, start), lt(start, n))) // Store the length.
mstore(0x40, add(mload(args), add(args, 0x40))) // Allocate memory.
Expand Down Expand Up @@ -2242,7 +2242,7 @@ library LibClone {
assembly {
args := mload(0x40)
let n := and(0xffffffffff, sub(extcodesize(instance), 0x52))
let l := sub(n, mul(lt(shr(24, start), lt(start, n)), start))
let l := sub(n, and(0xffffff, mul(lt(start, n), start)))
extcodecopy(instance, add(args, 0x20), add(start, 0x52), add(l, 0x20))
mstore(args, mul(sub(n, start), lt(start, n))) // Store the length.
mstore(0x40, add(args, add(0x40, mload(args)))) // Allocate memory.
Expand Down Expand Up @@ -2745,7 +2745,7 @@ library LibClone {
assembly {
args := mload(0x40)
let n := and(0xffffffffff, sub(extcodesize(instance), 0x57))
let l := sub(n, mul(lt(shr(24, start), lt(start, n)), start))
let l := sub(n, and(0xffffff, mul(lt(start, n), start)))
extcodecopy(instance, add(args, 0x20), add(start, 0x57), add(l, 0x20))
mstore(args, mul(sub(n, start), lt(start, n))) // Store the length.
mstore(0x40, add(args, add(0x40, mload(args)))) // Allocate memory.
Expand Down
2 changes: 1 addition & 1 deletion src/utils/SSTORE2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ library SSTORE2 {
assembly {
data := mload(0x40)
let n := and(0xffffffffff, sub(extcodesize(pointer), 0x01))
let l := sub(n, mul(lt(shr(24, start), lt(start, n)), start))
let l := sub(n, and(0xffffff, mul(lt(start, n), start)))
extcodecopy(pointer, add(data, 0x1f), start, add(l, 0x21))
mstore(data, mul(sub(n, start), lt(start, n))) // Store the length.
mstore(0x40, add(data, add(0x40, mload(data)))) // Allocate memory.
Expand Down

0 comments on commit 2790f7c

Please sign in to comment.