]> Cypherpunks repositories - gostls13.git/commit
reflect: add Value.MapRange method and MapIter type
authorAlan Donovan <adonovan@google.com>
Wed, 23 Nov 2016 20:34:08 +0000 (15:34 -0500)
committerAlan Donovan <adonovan@google.com>
Wed, 22 Aug 2018 20:16:01 +0000 (20:16 +0000)
commitede59583858bd64a09479f624e989e7c35df0c52
treeade2286e0b5149e9dfab30b6125343ef0381862a
parent8c0425825ced4042eac0439161abe1f22a47d615
reflect: add Value.MapRange method and MapIter type

Example of use:

iter := reflect.ValueOf(m).MapRange()
  for iter.Next() {
k := iter.Key()
v := iter.Value()
...
}

See issue golang/go#11104

Q. Are there any benchmarks that would exercise the new calls to
   copyval in existing code?

Change-Id: Ic469fcab5f1d9d853e76225f89bde01ee1d36e7a
Reviewed-on: https://go-review.googlesource.com/33572
Reviewed-by: Keith Randall <khr@golang.org>
src/reflect/all_test.go
src/reflect/value.go
src/runtime/map.go