From 9aba81badcd3f0a20102bf6236213523b2372c47 Mon Sep 17 00:00:00 2001 From: yajianggroup Date: Tue, 23 Sep 2025 16:01:10 +0800 Subject: [PATCH] cmd: using testing.B.Loop Signed-off-by: yajianggroup --- cmd/evm/runner.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/evm/runner.go b/cmd/evm/runner.go index ebb3e04461..772f5c7de5 100644 --- a/cmd/evm/runner.go +++ b/cmd/evm/runner.go @@ -158,7 +158,7 @@ func timedExec(bench bool, execFunc func() ([]byte, uint64, error)) ([]byte, exe // Do one warm-up run output, gasUsed, err := execFunc() result := testing.Benchmark(func(b *testing.B) { - for i := 0; i < b.N; i++ { + for b.Loop() { haveOutput, haveGasUsed, haveErr := execFunc() if !bytes.Equal(haveOutput, output) { panic(fmt.Sprintf("output differs\nhave %x\nwant %x\n", haveOutput, output))