]> Cypherpunks repositories - gostls13.git/commitdiff
reflect: remove unnecessary indirection in TestCopy.
authorNigel Tao <nigeltao@golang.org>
Wed, 15 Dec 2010 09:54:11 +0000 (20:54 +1100)
committerNigel Tao <nigeltao@golang.org>
Wed, 15 Dec 2010 09:54:11 +0000 (20:54 +1100)
R=r
CC=golang-dev
https://golang.org/cl/3642041

src/pkg/reflect/all_test.go

index 1652e173161983cb03fa0d3483194866d94508bf..7d34e5ca30f669f4160781b7ef36be2e94268b54 100644 (file)
@@ -549,15 +549,13 @@ func TestCopy(t *testing.T) {
        a := []int{1, 2, 3, 4, 10, 9, 8, 7}
        b := []int{11, 22, 33, 44, 1010, 99, 88, 77, 66, 55, 44}
        c := []int{11, 22, 33, 44, 1010, 99, 88, 77, 66, 55, 44}
-       va := NewValue(&a)
-       vb := NewValue(&b)
        for i := 0; i < len(b); i++ {
                if b[i] != c[i] {
                        t.Fatalf("b != c before test")
                }
        }
-       aa := va.(*PtrValue).Elem().(*SliceValue)
-       ab := vb.(*PtrValue).Elem().(*SliceValue)
+       aa := NewValue(a).(*SliceValue)
+       ab := NewValue(b).(*SliceValue)
        for tocopy := 1; tocopy <= 7; tocopy++ {
                aa.SetLen(tocopy)
                Copy(ab, aa)