From cd73d10801a8bf6bdd23387eabfa21e92007fdb0 Mon Sep 17 00:00:00 2001 From: solunolab Date: Thu, 4 Jun 2026 22:25:33 +0800 Subject: [PATCH] refactor: use the built-in min to simplify the code Signed-off-by: solunolab --- cmd/pos/exitproof/cmd.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cmd/pos/exitproof/cmd.go b/cmd/pos/exitproof/cmd.go index c5190c248..4fd4b5d98 100644 --- a/cmd/pos/exitproof/cmd.go +++ b/cmd/pos/exitproof/cmd.go @@ -620,11 +620,7 @@ func fetchBlockHashesBatched(ctx context.Context, rpc *ethrpc.Client, start, end } for batchStart := uint64(0); batchStart < count; batchStart += headerFetchBatchSize { - batchEnd := batchStart + headerFetchBatchSize - if batchEnd > count { - batchEnd = count - } - batchLen := batchEnd - batchStart + batchLen := min(batchStart+headerFetchBatchSize, count) - batchStart elems := make([]ethrpc.BatchElem, batchLen) results := make([]blockHeader, batchLen)