Skip to content

Commit

Permalink
replace results.push with index
Browse files Browse the repository at this point in the history
  • Loading branch information
mouseless0x committed Oct 4, 2024
1 parent 8b41b05 commit 5afe479
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/EntryPointSimulations.sol
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ contract EntryPointSimulations is EntryPoint, IEntryPointSimulations {
PackedUserOperation[] calldata ops
) public returns (ExecutionResult[] memory) {
ExecutionResult[] memory results = new ExecutionResult[](ops.length);
uint256 resultsIndex = 0;

for (uint256 i = 0; i < ops.length; i++) {
(bool success, bytes memory returnData) = address(this).call(
Expand All @@ -241,7 +242,7 @@ contract EntryPointSimulations is EntryPoint, IEntryPointSimulations {
returnData,
(ExecutionResult)
);
results.push(execResult);
results[resultsIndex++] = execResult;
}

// revert only at last as we are estimating only the last call
Expand Down

0 comments on commit 5afe479

Please sign in to comment.