Skip to content

Commit 269e80b

Browse files
authored
eth/tracers,trie: remove unnecessary check (#30071)
1 parent 9298d2d commit 269e80b

File tree

3 files changed

+13
-19
lines changed

3 files changed

+13
-19
lines changed

eth/tracers/live/supply.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,10 @@ func (s *supply) internalTxsHandler(call *supplyTxCallstack) {
204204
s.delta.Burn.Misc.Add(s.delta.Burn.Misc, call.burn)
205205
}
206206

207-
if len(call.calls) > 0 {
208-
// Recursively handle internal calls
209-
for _, call := range call.calls {
210-
callCopy := call
211-
s.internalTxsHandler(&callCopy)
212-
}
207+
// Recursively handle internal calls
208+
for _, call := range call.calls {
209+
callCopy := call
210+
s.internalTxsHandler(&callCopy)
213211
}
214212
}
215213

eth/tracers/native/call_flat.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -274,16 +274,14 @@ func flatFromNested(input *callFrame, traceAddress []int, convertErrs bool, ctx
274274
}
275275

276276
output = append(output, *frame)
277-
if len(input.Calls) > 0 {
278-
for i, childCall := range input.Calls {
279-
childAddr := childTraceAddress(traceAddress, i)
280-
childCallCopy := childCall
281-
flat, err := flatFromNested(&childCallCopy, childAddr, convertErrs, ctx)
282-
if err != nil {
283-
return nil, err
284-
}
285-
output = append(output, flat...)
277+
for i, childCall := range input.Calls {
278+
childAddr := childTraceAddress(traceAddress, i)
279+
childCallCopy := childCall
280+
flat, err := flatFromNested(&childCallCopy, childAddr, convertErrs, ctx)
281+
if err != nil {
282+
return nil, err
286283
}
284+
output = append(output, flat...)
287285
}
288286

289287
return output, nil

trie/verkle.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,8 @@ func (t *VerkleTrie) UpdateAccount(addr common.Address, acc *types.StateAccount)
144144

145145
// Encode balance in little-endian
146146
bytes := acc.Balance.Bytes()
147-
if len(bytes) > 0 {
148-
for i, b := range bytes {
149-
balance[len(bytes)-i-1] = b
150-
}
147+
for i, b := range bytes {
148+
balance[len(bytes)-i-1] = b
151149
}
152150
values[utils.BalanceLeafKey] = balance[:]
153151

0 commit comments

Comments
 (0)