mirror of https://github.com/golang/go.git
container/heap: remove confusing claim of memory leak
This commit is contained in:
parent
2184a39477
commit
3febcd0ba4
|
|
@ -45,7 +45,7 @@ func (pq *PriorityQueue) Pop() any {
|
|||
old := *pq
|
||||
n := len(old)
|
||||
item := old[n-1]
|
||||
old[n-1] = nil // avoid memory leak
|
||||
old[n-1] = nil // don't stop the GC from reclaiming the item eventually
|
||||
item.index = -1 // for safety
|
||||
*pq = old[0 : n-1]
|
||||
return item
|
||||
|
|
|
|||
Loading…
Reference in New Issue