Skip to content

Commit

Permalink
fix: [spearbit-11] Clear bits more efficiently (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
dphilipson authored and adamegyed committed Jan 19, 2024
1 parent 25a6edb commit 4de467c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/account/AccountExecutor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ abstract contract AccountExecutor {
// mask out the fist 4 bytes, then OR in the new selector.
let existingWord := mload(add(buffer, 0x20))
// Clear the upper 4 bytes of the existing word
existingWord := and(existingWord, shr(32, not(0)))
existingWord := shr(32, shl(32, existingWord))
// Clear the lower 28 bytes of the selector
pluginSelector := and(pluginSelector, shl(224, 0xFFFFFFFF))
pluginSelector := shl(224, shr(224, pluginSelector))
// OR in the new selector
existingWord := or(existingWord, pluginSelector)
mstore(add(buffer, 0x20), existingWord)
Expand Down

0 comments on commit 4de467c

Please sign in to comment.