mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
324f38a222
commit
df1739c77d
4 changed files with 81 additions and 3 deletions
|
|
@ -73,6 +73,7 @@ type maptype struct {
|
|||
valuesize uint8 // size of value slot
|
||||
indirectvalue bool // store ptr to value instead of value itself
|
||||
bucketsize uint16 // size of bucket
|
||||
reflexivekey bool // true if k==k for all keys
|
||||
}
|
||||
|
||||
type chantype struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue