diff options
author | Nigel Tao <nigeltao@golang.org> | 2010-12-15 20:54:11 +1100 |
---|---|---|
committer | Nigel Tao <nigeltao@golang.org> | 2010-12-15 20:54:11 +1100 |
commit | 53a29f5d741692b0e1f4506eac150083c62c8090 (patch) | |
tree | f0958dc20a369cb7f31927ab604701fd66a0c434 /src/pkg/reflect | |
parent | 244602e1f77505a78add7ee10fca8a6d519d6ff1 (diff) | |
download | go-53a29f5d741692b0e1f4506eac150083c62c8090.tar.gz |
reflect: remove unnecessary indirection in TestCopy.
R=r
CC=golang-dev
http://codereview.appspot.com/3642041
Diffstat (limited to 'src/pkg/reflect')
-rw-r--r-- | src/pkg/reflect/all_test.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/pkg/reflect/all_test.go b/src/pkg/reflect/all_test.go index 1652e1731..7d34e5ca3 100644 --- a/src/pkg/reflect/all_test.go +++ b/src/pkg/reflect/all_test.go @@ -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) |