mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32: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{} {
|
func (h *nonceHeap) Pop() interface{} {
|
||||||
old := *h
|
var x interface{}
|
||||||
n := len(old)
|
x, *h = (*h)[len(*h)-1], (*h)[:len(*h)-1]
|
||||||
x := old[n-1]
|
|
||||||
old[n-1] = 0
|
|
||||||
*h = old[0 : n-1]
|
|
||||||
return x
|
return x
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue