container/heap: remove confusing claim of memory leak

This commit is contained in:
codesoap 2024-01-31 19:20:27 +01:00
parent 2184a39477
commit 3febcd0ba4
1 changed files with 1 additions and 1 deletions

View File

@ -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