From a29939938bbc506900665c40903baf8c34524cfd Mon Sep 17 00:00:00 2001 From: CMajeri Date: Tue, 21 Jun 2022 09:36:16 +0200 Subject: [PATCH] Simplify loop --- eth/tracers/logger/logger.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eth/tracers/logger/logger.go b/eth/tracers/logger/logger.go index 0f1f89320c..78b279efd7 100644 --- a/eth/tracers/logger/logger.go +++ b/eth/tracers/logger/logger.go @@ -174,7 +174,8 @@ func (l *StructLogger) CaptureState(pc uint64, op vm.OpCode, gas, cost uint64, s memory := scope.Memory stack := scope.Stack contract := scope.Contract - for i := l.depth - (depth - 1); l.depth > depth-1; l.depth, i = l.depth-1, i-1 { + for ; l.depth > depth-1; l.depth = l.depth - 1 { + i := l.depth - (depth - 1) if l.current.error == nil { switch stack.Data()[len(stack.Data())-i].Bytes32()[31] { case 0x00: