mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
simplify Pop function in nonceHeap
This commit is contained in:
parent
045b9718d5
commit
72f23710ba
1 changed files with 2 additions and 5 deletions
|
|
@ -44,11 +44,8 @@ func (h *nonceHeap) Push(x interface{}) {
|
|||
}
|
||||
|
||||
func (h *nonceHeap) Pop() interface{} {
|
||||
old := *h
|
||||
n := len(old)
|
||||
x := old[n-1]
|
||||
old[n-1] = 0
|
||||
*h = old[0 : n-1]
|
||||
var x interface{}
|
||||
x, *h = (*h)[len(*h)-1], (*h)[:len(*h)-1]
|
||||
return x
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue