diff options
author | Russ Cox <rsc@golang.org> | 2009-10-06 14:55:39 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-10-06 14:55:39 -0700 |
commit | d2c438c32027a1bcaa2a20e7626495fedcef804a (patch) | |
tree | d4e306848aa66193a42b8531963e246bdb4ed364 /src/pkg/container/vector/stringvector.go | |
parent | a7bf4bfaf01a627bbb1be972608820be08e80512 (diff) | |
download | golang-d2c438c32027a1bcaa2a20e7626495fedcef804a.tar.gz |
another round of gofmt applications
R=gri
DELTA=900 (106 added, 31 deleted, 763 changed)
OCL=35384
CL=35396
Diffstat (limited to 'src/pkg/container/vector/stringvector.go')
-rw-r--r-- | src/pkg/container/vector/stringvector.go | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/pkg/container/vector/stringvector.go b/src/pkg/container/vector/stringvector.go index cda9760d2..4949d06b7 100644 --- a/src/pkg/container/vector/stringvector.go +++ b/src/pkg/container/vector/stringvector.go @@ -21,25 +21,25 @@ func (p *StringVector) Init(len int) *StringVector { // NewStringVector returns an initialized new StringVector with length at least len. func NewStringVector(len int) *StringVector { - return new(StringVector).Init(len) + return new(StringVector).Init(len); } // At returns the i'th element of the vector. func (p *StringVector) At(i int) string { - return p.Vector.At(i).(string) + return p.Vector.At(i).(string); } // Set sets the i'th element of the vector to value x. func (p *StringVector) Set(i int, x string) { - p.a[i] = x + p.a[i] = x; } // Last returns the element in the vector of highest index. func (p *StringVector) Last() string { - return p.Vector.Last().(string) + return p.Vector.Last().(string); } @@ -47,42 +47,42 @@ func (p *StringVector) Last() string { func (p *StringVector) Data() []string { arr := make([]string, p.Len()); for i, v := range p.a { - arr[i] = v.(string) + arr[i] = v.(string); } - return arr + return arr; } // Insert inserts into the vector an element of value x before // the current element at index i. func (p *StringVector) Insert(i int, x string) { - p.Vector.Insert(i, x) + p.Vector.Insert(i, x); } // InsertVector inserts into the vector the contents of the Vector // x such that the 0th element of x appears at index i after insertion. func (p *StringVector) InsertVector(i int, x *StringVector) { - p.Vector.InsertVector(i, &x.Vector) + p.Vector.InsertVector(i, &x.Vector); } // Slice returns a new StringVector by slicing the old one to extract slice [i:j]. // The elements are copied. The original vector is unchanged. func (p *StringVector) Slice(i, j int) *StringVector { - return &StringVector{ *p.Vector.Slice(i, j) }; + return &StringVector{*p.Vector.Slice(i, j)}; } // Push appends x to the end of the vector. func (p *StringVector) Push(x string) { - p.Vector.Push(x) + p.Vector.Push(x); } // Pop deletes and returns the last element of the vector. func (p *StringVector) Pop() string { - return p.Vector.Pop().(string) + return p.Vector.Pop().(string); } @@ -95,14 +95,14 @@ func (p *StringVector) AppendVector(x *StringVector) { // SortInterface support // Less returns a boolean denoting whether the i'th element is less than the j'th element. func (p *StringVector) Less(i, j int) bool { - return p.At(i) < p.At(j) + return p.At(i) < p.At(j); } // Iterate over all elements; driver for range func (p *StringVector) iterate(c chan<- string) { for _, v := range p.a { - c <- v.(string) + c <- v.(string); } close(c); } |