From df1739c77d4eb4f700722b4eb70b6036df96a9b9 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Fri, 12 Dec 2014 13:45:19 -0800 Subject: 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 --- src/runtime/type.go | 1 + 1 file changed, 1 insertion(+) (limited to 'src/runtime/type.go') diff --git a/src/runtime/type.go b/src/runtime/type.go index cbd5c9ebc2..cbf2b1b6af 100644 --- a/src/runtime/type.go +++ b/src/runtime/type.go @@ -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 { -- cgit v1.3-5-g9baa