Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core, txpool: less allocations when handling transactions #21232

Merged
merged 8 commits into from
Jul 1, 2020
Prev Previous commit
Next Next commit
Update core/tx_list.go
  • Loading branch information
holiman authored and MariusVanDerWijden committed Jul 1, 2020
commit b2f8a012f5f4eb269a5e3104dd407d44466c3850
2 changes: 1 addition & 1 deletion core/tx_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func (m *txSortedMap) Flatten() types.Transactions {
// transaction with the highest nonce
func (m *txSortedMap) LastElement() *types.Transaction {
cache := m.flatten()
return cache[len(m.cache)-1]
return cache[len(cache)-1]
}

// txList is a "list" of transactions belonging to an account, sorted by account
Expand Down