]> Cypherpunks repositories - gostls13.git/commit
reflect: make Value.MapRange inlineable
authorJoe Tsai <joetsai@digital-static.net>
Sun, 17 Apr 2022 03:23:28 +0000 (20:23 -0700)
committerGopher Robot <gobot@golang.org>
Mon, 18 Apr 2022 22:14:50 +0000 (22:14 +0000)
commitc5edd5f616b4ee4bbaefdb1579c6078e7ed7e84e
tree32df92d62203cd08f36dc643530f2ff3e0ef4aee
parentf49e802892a225c7fd14a3a8bb8c0e83875d888d
reflect: make Value.MapRange inlineable

This allows the caller to decide whether MapIter should be
stack allocated or heap allocated based on whether it escapes.
In most cases, it does not escape and thus removes the utility
of MapIter.Reset (#46293). In fact, use of sync.Pool with MapIter
and calling MapIter.Reset is likely to be slower.

Change-Id: Ic93e7d39e5dd4c83e7fca9e0bdfbbcd70777f0e1
Reviewed-on: https://go-review.googlesource.com/c/go/+/400675
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/compile/internal/test/inl_test.go
src/reflect/all_test.go
src/reflect/value.go