]> Cypherpunks repositories - gostls13.git/commit
reflect: use arrayAt consistently
authorSebastien Binet <seb.binet@gmail.com>
Tue, 27 Jan 2015 09:04:11 +0000 (10:04 +0100)
committerKeith Randall <khr@golang.org>
Tue, 21 Apr 2015 17:29:25 +0000 (17:29 +0000)
commite00e65638ac33c13d39b7b4225354e932256005b
tree0e4513d094723139a46b89612ac4116ab11aed27
parent873483c682747e8ce881c1bf8ac4428a01836324
reflect: use arrayAt consistently

This change refactors reflect.Value to consistently use arrayAt when an element
of an array of bytes is indexed.

This effectively replaces:
 arr := unsafe.Pointer(...)
 arri := unsafe.Pointer(uintptr(arr) + uintptr(i)*elementSize)

with:
 arr := unsafe.Pointer(...)
 arri := arrayAt(arr, i, elementSize)

Change-Id: I53ffd0d6de693b43d5c10c0aa4cd6d4f5e95a1e3
Reviewed-on: https://go-review.googlesource.com/9183
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/reflect/value.go