From e16b071108d0caf1aa3cd94c2dab5693339a582a Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 24 Jun 2021 14:37:50 +0200 Subject: [PATCH] remove unneeded loop --- libs/remix-debug/src/code/codeManager.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libs/remix-debug/src/code/codeManager.ts b/libs/remix-debug/src/code/codeManager.ts index 207f3e0510..390c988eed 100644 --- a/libs/remix-debug/src/code/codeManager.ts +++ b/libs/remix-debug/src/code/codeManager.ts @@ -156,18 +156,20 @@ export class CodeManager { next = codeMananger.getInstructionIndex(address, step + 1) let values = this.traceManager.getAllStopIndexes() - values = values.filter((value) => value.address === address) if (values) { for (const value of values) { - returnInstructionIndexes.push({ instructionIndex: this.getInstructionIndex(address, value.index), address }) + if (value.address === address) { + returnInstructionIndexes.push({ instructionIndex: this.getInstructionIndex(address, value.index), address }) + } } } values = this.traceManager.getAllOutofGasIndexes() - values = values.filter((value) => value.address === address) if (values) { for (const value of values) { - outOfGasInstructionIndexes.push({ instructionIndex: this.getInstructionIndex(address, value.index), address }) + if (value.address === address) { + outOfGasInstructionIndexes.push({ instructionIndex: this.getInstructionIndex(address, value.index), address }) + } } } } catch (error) {