]> Cypherpunks repositories - gostls13.git/commit
runtime: if key type is reflexive, don't call equal(k, k)
authorKeith Randall <khr@golang.org>
Fri, 12 Dec 2014 21:45:19 +0000 (13:45 -0800)
committerKeith Randall <khr@golang.org>
Mon, 15 Dec 2014 21:43:49 +0000 (21:43 +0000)
commitdf1739c77d4eb4f700722b4eb70b6036df96a9b9
tree4aacf736bac265bfb82a14010410ab7f426420fa
parent324f38a222cc48439a11a5545c85cb8614385987
runtime: if key type is reflexive, don't call equal(k, k)

Most types are reflexive (k == k for all k of type t), so don't
bother calling equal(k, k) when the key type is reflexive.

Change-Id: Ia716b4198b8b298687843b94b878dbc5e8fc2c65
Reviewed-on: https://go-review.googlesource.com/1480
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/gc/reflect.c
src/reflect/type.go
src/runtime/hashmap.go
src/runtime/type.go