mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 18:30:45 +00:00
This commit is contained in:
parent
d75f2822d3
commit
d3e994377b
2 changed files with 2 additions and 0 deletions
|
|
@ -46,6 +46,7 @@ func (h *nonceHeap) Pop() interface{} {
|
||||||
old := *h
|
old := *h
|
||||||
n := len(old)
|
n := len(old)
|
||||||
x := old[n-1]
|
x := old[n-1]
|
||||||
|
old[n-1] = 0 // avoid memory leak
|
||||||
*h = old[0 : n-1]
|
*h = old[0 : n-1]
|
||||||
return x
|
return x
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -704,6 +704,7 @@ func (s *TxByPriceAndTime) Pop() interface{} {
|
||||||
old := s.txs
|
old := s.txs
|
||||||
n := len(old)
|
n := len(old)
|
||||||
x := old[n-1]
|
x := old[n-1]
|
||||||
|
old[n-1] = nil // avoid memory leak
|
||||||
s.txs = old[0 : n-1]
|
s.txs = old[0 : n-1]
|
||||||
return x
|
return x
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue