Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Aug 27, 2024
1 parent 5932f07 commit fc99c9c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
5 changes: 1 addition & 4 deletions types/mempool/priority_nonce.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,7 @@ func (mp *PriorityNonceMempool[C]) SelectBy(_ context.Context, _ [][]byte, callb
}

iter := iterator.iteratePriority()
for iter != nil {
if !callback(iter.Tx()) {
break
}
for iter != nil && callback(iter.Tx()) {
iter = iter.Next()
}
}
Expand Down
1 change: 1 addition & 0 deletions types/mempool/priority_nonce_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ func (s *MempoolTestSuite) TestIteratorConcurrency() {
}
return i < len(tt.txs)
})
require.Equal(t, i, len(tt.txs))
cancel()
wg.Wait()
})
Expand Down
5 changes: 1 addition & 4 deletions types/mempool/sender_nonce.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,7 @@ func (snm *SenderNonceMempool) SelectBy(_ context.Context, _ [][]byte, callback
}

iter := iterator.Next()
for iter != nil {
if !callback(iter.Tx()) {
break
}
for iter != nil && callback(iter.Tx()) {
iter = iter.Next()
}
}
Expand Down

0 comments on commit fc99c9c

Please sign in to comment.