]> Cypherpunks repositories - gostls13.git/commitdiff
- clarify vector comment
authorRobert Griesemer <gri@golang.org>
Tue, 8 Sep 2009 21:29:41 +0000 (14:29 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 8 Sep 2009 21:29:41 +0000 (14:29 -0700)
- adjusted a test to check claim

R=rsc
DELTA=3  (2 added, 0 deleted, 1 changed)
OCL=34454
CL=34456

src/pkg/container/vector/vector.go
src/pkg/container/vector/vector_test.go

index ba5e881d16424ded162ea381c3eecf6c8927c7af..483928c69bcff53ebcfca34e1740234936099622 100644 (file)
@@ -12,6 +12,7 @@ type Element interface {}
 
 
 // Vector is the container itself.
+// The zero value for Vector is an empty vector ready to use.
 type Vector struct {
        a []Element
 }
index 51acb747466d3db7be3ba19c8a8c4e0fc1915530..c0d67957d914568904f04436e4dccaa51b6199cf 100644 (file)
@@ -52,7 +52,7 @@ func TestAccess(t *testing.T) {
 
 func TestInsertDeleteClear(t *testing.T) {
        const n = 100;
-       a := New(0);
+       var a Vector;
 
        for i := 0; i < n; i++ {
                if a.Len() != i { t.Errorf("A) wrong len %d (expected %d)", a.Len(), i) }
@@ -189,6 +189,7 @@ func TestDo(t *testing.T) {
        }
 }
 
+
 func TestIter(t *testing.T) {
        const Len = 100;
        x := New(Len);