]> Cypherpunks repositories - gostls13.git/commit
runtime: calculate k only once in mapiternext
authorJosh Bleecher Snyder <josharian@gmail.com>
Fri, 11 Aug 2017 15:43:30 +0000 (08:43 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Mon, 14 Aug 2017 23:32:56 +0000 (23:32 +0000)
commit589fc314af46e0d65a91fa1048ba319f1bf390a6
tree4f3b843898a930cd623034e1b72ce74d2d9e5912
parent29e9b89b9ada73fa7775b351c100709c330c0a46
runtime: calculate k only once in mapiternext

Make the calculation of k and v a bit lazier.
None of the following code cares about indirect-vs-direct k,
and it happens on all code paths, so check t.indirectkey earlier.

Simplifies the code and reduces both machine code and stack size.

Change-Id: I5ea4c0772848d7a4b15383baedb9a1f7feb47201
Reviewed-on: https://go-review.googlesource.com/55092
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/runtime/hashmap.go