@@ -26,7 +26,7 @@ func newBenchPool() *TxPool {
2626// Signing is ECDSA and expensive, so it must happen outside the timed region.
2727func genBenchTxs (pool * TxPool , n , workerIdx int ) []* tx.Transaction {
2828 txs := make ([]* tx.Transaction , n )
29- for i := 0 ; i < n ; i ++ {
29+ for i := range n {
3030 from := devAccounts [(workerIdx + i )% len (devAccounts )]
3131 txs [i ] = newTx (tx .TypeLegacy , pool .repo .ChainTag (), nil , 21000 , tx.BlockRef {}, 100 , nil , tx .Features (0 ), from )
3232 }
@@ -38,7 +38,7 @@ func benchAddRemove(b *testing.B, workers, perWorker int, withWash bool) {
3838 defer pool .Close ()
3939
4040 sets := make ([][]* tx.Transaction , workers )
41- for w := 0 ; w < workers ; w ++ {
41+ for w := range workers {
4242 sets [w ] = genBenchTxs (pool , perWorker , w )
4343 }
4444
@@ -62,11 +62,11 @@ func benchAddRemove(b *testing.B, workers, perWorker int, withWash bool) {
6262
6363 var wg sync.WaitGroup
6464 per := b .N / workers
65- for w := 0 ; w < workers ; w ++ {
65+ for w := range workers {
6666 wg .Add (1 )
6767 go func (set []* tx.Transaction ) {
6868 defer wg .Done ()
69- for i := 0 ; i < per ; i ++ {
69+ for i := range per {
7070 trx := set [i % len (set )]
7171 _ = pool .Add (trx ) // publishes pricing snapshot (atomic Store) + bookkeeping (map lock)
7272 pool .Remove (trx .Hash (), trx .ID ()) // reads Cost()/Payer() (atomic Load) + bookkeeping (map lock)
0 commit comments