summaryrefslogtreecommitdiff
path: root/src/pkg/container/vector/stringvector.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/container/vector/stringvector.go')
-rw-r--r--src/pkg/container/vector/stringvector.go21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/pkg/container/vector/stringvector.go b/src/pkg/container/vector/stringvector.go
index ddc030f81..852685f5a 100644
--- a/src/pkg/container/vector/stringvector.go
+++ b/src/pkg/container/vector/stringvector.go
@@ -104,8 +104,8 @@ func (p *StringVector) Set(i int, x string) { (*p)[i] = x }
func (p *StringVector) Last() string { return (*p)[len(*p)-1] }
-// Data returns all the elements as a slice.
-func (p *StringVector) Data() []string {
+// Copy makes a copy of the vector and returns it.
+func (p *StringVector) Copy() StringVector {
arr := make(StringVector, len(*p))
copy(arr, *p)
return arr
@@ -199,23 +199,6 @@ func (p *StringVector) Swap(i, j int) {
}
-// Iterate over all elements; driver for range
-func (p *StringVector) iterate(c chan<- string) {
- for _, v := range *p {
- c <- v
- }
- close(c)
-}
-
-
-// Channel iterator for range.
-func (p *StringVector) Iter() <-chan string {
- c := make(chan string)
- 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 *StringVector) Do(f func(elem string)) {