]> Cypherpunks repositories - gostls13.git/commit
encoding/json: simplify (*decodeState).indirect
authorMicah Stetson <micah.stetson@gmail.com>
Mon, 25 Jun 2012 20:03:18 +0000 (16:03 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 25 Jun 2012 20:03:18 +0000 (16:03 -0400)
commit51ff2ef409ef0e9b3748540e37ff378a9b8bcaea
treeb87339d3a256cb7af5e18436f0d4ab1470e8624f
parent32a0cbb88187deecfcbcf62f11056ca09fe4a4a0
encoding/json: simplify (*decodeState).indirect

Removes an incorrect code comment and some superfluous variables.

The comment I removed says that struct fields which implement
Unmarshaler must be pointers, even if they're in an addressable
struct. That's not the case, and there's already a test in decode_test.go
that demonstrates as much.

Encoding/json has quite a few assignments of reflect.Values to extra
variables – things like "iv := v" when there's no need to make a copy. I
think these are left over from a previous version of the reflect API. If they
aren't wanted, I wouldn't mind going through the package and getting
rid of the rest of them.

R=rsc
CC=golang-dev
https://golang.org/cl/6318047
src/pkg/encoding/json/decode.go