]> Cypherpunks repositories - gostls13.git/commit
all: refer to map elements as elements instead of values
authorJosh Bleecher Snyder <josharian@gmail.com>
Mon, 22 Apr 2019 20:37:08 +0000 (13:37 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Tue, 30 Apr 2019 18:18:12 +0000 (18:18 +0000)
commit73cb9a1cb3d9d31a8276aaa2aebfb8b35509e05c
tree2811c612c1eb11bc686626310ee50b4a4be6709e
parenta8d0047e473510db1b1a5e35c03fdf41a13b5733
all: refer to map elements as elements instead of values

The spec carefully and consistently uses "key" and "element"
as map terminology. The implementation, not so much.

This change attempts to make the implementation consistently
hew to the spec's terminology. Beyond consistency, this has
the advantage of avoid some confusion and naming collisions,
since v and value are very generic and commonly used terms.

I believe that I found all everything, but there are a lot of
non-obvious places for these to hide, and grepping for them is hard.
Hopefully this change changes enough of them that we will start using
elem going forward. Any remaining hidden cases can be removed ad hoc
as they are discovered.

The only externally-facing part of this change is in package reflect,
where there is a minor doc change and a function parameter name change.

Updates #27167

Change-Id: I2f2d78f16c360dc39007b9966d5c2046a29d3701
Reviewed-on: https://go-review.googlesource.com/c/go/+/174523
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/gc/range.go
src/cmd/compile/internal/gc/reflect.go
src/cmd/compile/internal/gc/sinit.go
src/cmd/compile/internal/gc/walk.go
src/reflect/value.go
src/runtime/map.go
src/runtime/map_fast32.go
src/runtime/map_fast64.go
src/runtime/map_faststr.go
src/runtime/type.go