From 007b4ce5fbcf41e58378256963f754038e68c8e2 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Mon, 1 Oct 2018 14:07:23 -0400 Subject: [PATCH] refactor; remove unneded else --- src/app/debugger/debuggerUI/VmDebugger.js | 27 +++++++++++------------ 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/app/debugger/debuggerUI/VmDebugger.js b/src/app/debugger/debuggerUI/VmDebugger.js index 8b63b1e784..7c4bd56baa 100644 --- a/src/app/debugger/debuggerUI/VmDebugger.js +++ b/src/app/debugger/debuggerUI/VmDebugger.js @@ -186,20 +186,19 @@ class VmDebuggerLogic { if (self._parent.currentStepIndex !== index) return if (!self.storageResolver) return - if (index === self.traceLength - 1) { - var storageJSON = {} - for (var k in self.addresses) { - var address = self.addresses[k] - var storageViewer = new StorageViewer({ stepIndex: self._parent.currentStepIndex, tx: self._parent.tx, address: address }, self.storageResolver, self._traceManager) - storageViewer.storageRange(function (error, result) { - if (!error) { - storageJSON[address] = result - self.event.trigger('traceLengthUpdate', [storageJSON]) - } - }) - } - } else { - self.event.trigger('traceLengthUpdate', [{}]) + if (index !== self.traceLength - 1) { + return self.event.trigger('traceLengthUpdate', [{}]) + } + var storageJSON = {} + for (var k in self.addresses) { + var address = self.addresses[k] + var storageViewer = new StorageViewer({ stepIndex: self._parent.currentStepIndex, tx: self._parent.tx, address: address }, self.storageResolver, self._traceManager) + storageViewer.storageRange(function (error, result) { + if (!error) { + storageJSON[address] = result + self.event.trigger('traceLengthUpdate', [storageJSON]) + } + }) } }) }