aboutsummaryrefslogtreecommitdiff
path: root/src/container
diff options
context:
space:
mode:
authorbontequero <bontequero@gmail.com>2018-04-07 20:43:45 +0300
committerBrad Fitzpatrick <bradfitz@golang.org>2018-04-11 20:11:09 +0000
commit641c32264cbdfab2564bef72cd66b6806fc8dd11 (patch)
tree57580860a3cc417751e2d8634dc6c8e679e4f6ee /src/container
parente21a749af171d0b3c3abffded56b3d9a4e03b7eb (diff)
downloadgo-641c32264cbdfab2564bef72cd66b6806fc8dd11.tar.gz
go-641c32264cbdfab2564bef72cd66b6806fc8dd11.zip
container/heap: fix comments style
Fixes golint warning about comment on exported function. Change-Id: Ia6a910e2dca2cd31d8de64419e36add6191e804d Reviewed-on: https://go-review.googlesource.com/105495 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/container')
-rw-r--r--src/container/heap/heap.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/container/heap/heap.go b/src/container/heap/heap.go
index b2c64276c8..67b5efcac7 100644
--- a/src/container/heap/heap.go
+++ b/src/container/heap/heap.go
@@ -18,7 +18,9 @@ package heap
import "sort"
-// Any type that implements heap.Interface may be used as a
+// The Interface type describes the requirements
+// for a type using the routines in this package.
+// Any type that implements it may be used as a
// min-heap with the following invariants (established after
// Init has been called or if the data is empty or sorted):
//
@@ -33,11 +35,10 @@ type Interface interface {
Pop() interface{} // remove and return element Len() - 1.
}
-// A heap must be initialized before any of the heap operations
-// can be used. Init is idempotent with respect to the heap invariants
+// Init establishes the heap invariants required by the other routines in this package.
+// Init is idempotent with respect to the heap invariants
// and may be called whenever the heap invariants may have been invalidated.
// Its complexity is O(n) where n = h.Len().
-//
func Init(h Interface) {
// heapify
n := h.Len()