Skip to content

Commit

Permalink
fix: [spearbit-72] cache dependencies.length earlier (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaypaik authored Jan 8, 2024
1 parent c67dcb4 commit 27fe9de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/account/PluginManagerInternals.sol
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,11 @@ abstract contract PluginManagerInternals is IPluginManager, AccountStorageV1 {
}

// Check that the dependencies match the manifest.
if (dependencies.length != manifest.dependencyInterfaceIds.length) {
uint256 length = dependencies.length;
if (length != manifest.dependencyInterfaceIds.length) {
revert InvalidDependenciesProvided();
}

uint256 length = dependencies.length;
for (uint256 i = 0; i < length;) {
// Check the dependency interface id over the address of the dependency.
(address dependencyAddr,) = dependencies[i].unpack();
Expand Down

0 comments on commit 27fe9de

Please sign in to comment.