summaryrefslogtreecommitdiff
path: root/src/pkg/container/vector/intvector.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-10-06 14:55:39 -0700
committerRuss Cox <rsc@golang.org>2009-10-06 14:55:39 -0700
commitd2c438c32027a1bcaa2a20e7626495fedcef804a (patch)
treed4e306848aa66193a42b8531963e246bdb4ed364 /src/pkg/container/vector/intvector.go
parenta7bf4bfaf01a627bbb1be972608820be08e80512 (diff)
downloadgolang-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/intvector.go')
-rw-r--r--src/pkg/container/vector/intvector.go26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/pkg/container/vector/intvector.go b/src/pkg/container/vector/intvector.go
index 950926e10..0ae25b982 100644
--- a/src/pkg/container/vector/intvector.go
+++ b/src/pkg/container/vector/intvector.go
@@ -22,25 +22,25 @@ func (p *IntVector) Init(len int) *IntVector {
// NewIntVector returns an initialized new IntVector with length at least len.
func NewIntVector(len int) *IntVector {
- return new(IntVector).Init(len)
+ return new(IntVector).Init(len);
}
// At returns the i'th element of the vector.
func (p *IntVector) At(i int) int {
- return p.Vector.At(i).(int)
+ return p.Vector.At(i).(int);
}
// Set sets the i'th element of the vector to value x.
func (p *IntVector) Set(i int, x int) {
- p.a[i] = x
+ p.a[i] = x;
}
// Last returns the element in the vector of highest index.
func (p *IntVector) Last() int {
- return p.Vector.Last().(int)
+ return p.Vector.Last().(int);
}
@@ -48,42 +48,42 @@ func (p *IntVector) Last() int {
func (p *IntVector) Data() []int {
arr := make([]int, p.Len());
for i, v := range p.a {
- arr[i] = v.(int)
+ arr[i] = v.(int);
}
- return arr
+ return arr;
}
// Insert inserts into the vector an element of value x before
// the current element at index i.
func (p *IntVector) Insert(i int, x int) {
- 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 *IntVector) InsertVector(i int, x *IntVector) {
- p.Vector.InsertVector(i, &x.Vector)
+ p.Vector.InsertVector(i, &x.Vector);
}
// Slice returns a new IntVector by slicing the old one to extract slice [i:j].
// The elements are copied. The original vector is unchanged.
func (p *IntVector) Slice(i, j int) *IntVector {
- return &IntVector{ *p.Vector.Slice(i, j) };
+ return &IntVector{*p.Vector.Slice(i, j)};
}
// Push appends x to the end of the vector.
func (p *IntVector) Push(x int) {
- p.Vector.Push(x)
+ p.Vector.Push(x);
}
// Pop deletes and returns the last element of the vector.
func (p *IntVector) Pop() int {
- return p.Vector.Pop().(int)
+ return p.Vector.Pop().(int);
}
@@ -96,14 +96,14 @@ func (p *IntVector) AppendVector(x *IntVector) {
// SortInterface support
// Less returns a boolean denoting whether the i'th element is less than the j'th element.
func (p *IntVector) 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 *IntVector) iterate(c chan<- int) {
for _, v := range p.a {
- c <- v.(int)
+ c <- v.(int);
}
close(c);
}