1
0
mirror of https://github.com/golang/go synced 2024-11-13 19:10:22 -07:00

container/heap: clarify that Remove returns the removed element

Change-Id: I63b59c1ca8265e9af7eb3f9210ee1d17925de891
Reviewed-on: https://go-review.googlesource.com/129779
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Qais Patankar 2018-08-19 15:42:27 +01:00 committed by Brad Fitzpatrick
parent edae0ff8c1
commit 6570ea3c60

View File

@ -66,8 +66,8 @@ func Pop(h Interface) interface{} {
return h.Pop() return h.Pop()
} }
// Remove removes the element at index i from the heap. // Remove removes the element at index i from the heap and returns
// The complexity is O(log(n)) where n = h.Len(). // the element. The complexity is O(log(n)) where n = h.Len().
// //
func Remove(h Interface, i int) interface{} { func Remove(h Interface, i int) interface{} {
n := h.Len() - 1 n := h.Len() - 1