From 5afe47953cf907bfd3c12c8f65d6c745b98a6f0a Mon Sep 17 00:00:00 2001 From: mouseless <97399882+mouseless-eth@users.noreply.github.com> Date: Fri, 4 Oct 2024 16:36:45 +0100 Subject: [PATCH] replace results.push with index --- src/EntryPointSimulations.sol | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/EntryPointSimulations.sol b/src/EntryPointSimulations.sol index 5748f8f..5e8e403 100644 --- a/src/EntryPointSimulations.sol +++ b/src/EntryPointSimulations.sol @@ -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( @@ -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