summaryrefslogtreecommitdiff
path: root/src/pkg/container/ring/ring.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/container/ring/ring.go')
-rw-r--r--src/pkg/container/ring/ring.go9
1 files changed, 0 insertions, 9 deletions
diff --git a/src/pkg/container/ring/ring.go b/src/pkg/container/ring/ring.go
index cc870ce93..1d96918d3 100644
--- a/src/pkg/container/ring/ring.go
+++ b/src/pkg/container/ring/ring.go
@@ -16,14 +16,12 @@ type Ring struct {
Value interface{} // for use by client; untouched by this library
}
-
func (r *Ring) init() *Ring {
r.next = r
r.prev = r
return r
}
-
// Next returns the next ring element. r must not be empty.
func (r *Ring) Next() *Ring {
if r.next == nil {
@@ -32,7 +30,6 @@ func (r *Ring) Next() *Ring {
return r.next
}
-
// Prev returns the previous ring element. r must not be empty.
func (r *Ring) Prev() *Ring {
if r.next == nil {
@@ -41,7 +38,6 @@ func (r *Ring) Prev() *Ring {
return r.prev
}
-
// Move moves n % r.Len() elements backward (n < 0) or forward (n >= 0)
// in the ring and returns that ring element. r must not be empty.
//
@@ -62,7 +58,6 @@ func (r *Ring) Move(n int) *Ring {
return r
}
-
// New creates a ring of n elements.
func New(n int) *Ring {
if n <= 0 {
@@ -79,7 +74,6 @@ func New(n int) *Ring {
return r
}
-
// Link connects ring r with with ring s such that r.Next()
// becomes s and returns the original value for r.Next().
// r must not be empty.
@@ -110,7 +104,6 @@ func (r *Ring) Link(s *Ring) *Ring {
return n
}
-
// Unlink removes n % r.Len() elements from the ring r, starting
// at r.Next(). If n % r.Len() == 0, r remains unchanged.
// The result is the removed subring. r must not be empty.
@@ -122,7 +115,6 @@ func (r *Ring) Unlink(n int) *Ring {
return r.Link(r.Move(n + 1))
}
-
// Len computes the number of elements in ring r.
// It executes in time proportional to the number of elements.
//
@@ -137,7 +129,6 @@ func (r *Ring) Len() int {
return n
}
-
// Do calls function f on each element of the ring, in forward order.
// The behavior of Do is undefined if f changes *r.
func (r *Ring) Do(f func(interface{})) {