summaryrefslogtreecommitdiff
path: root/src/pkg/container/vector/intvector.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/container/vector/intvector.go')
-rw-r--r--src/pkg/container/vector/intvector.go21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/pkg/container/vector/intvector.go b/src/pkg/container/vector/intvector.go
index 6aad358e3..5ad9e294b 100644
--- a/src/pkg/container/vector/intvector.go
+++ b/src/pkg/container/vector/intvector.go
@@ -104,8 +104,8 @@ func (p *IntVector) Set(i int, x int) { (*p)[i] = x }
func (p *IntVector) Last() int { return (*p)[len(*p)-1] }
-// Data returns all the elements as a slice.
-func (p *IntVector) Data() []int {
+// Copy makes a copy of the vector and returns it.
+func (p *IntVector) Copy() IntVector {
arr := make(IntVector, len(*p))
copy(arr, *p)
return arr
@@ -199,23 +199,6 @@ func (p *IntVector) Swap(i, j int) {
}
-// Iterate over all elements; driver for range
-func (p *IntVector) iterate(c chan<- int) {
- for _, v := range *p {
- c <- v
- }
- close(c)
-}
-
-
-// Channel iterator for range.
-func (p *IntVector) Iter() <-chan int {
- c := make(chan int)
- go p.iterate(c)
- return c
-}
-
-
// Do calls function f for each element of the vector, in order.
// The behavior of Do is undefined if f changes *p.
func (p *IntVector) Do(f func(elem int)) {