From d1afd4f61396d69fa0d6719722e8fdb0296e8fc7 Mon Sep 17 00:00:00 2001 From: Anaminus Date: Thu, 19 Feb 2015 09:12:58 -0600 Subject: [PATCH] Don't check for types that don't support the == operator. This isn't necessary to do because these types cannot be keys in the first place. --- spew/common.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/spew/common.go b/spew/common.go index d15a8a6..c525a0e 100644 --- a/spew/common.go +++ b/spew/common.go @@ -358,16 +358,6 @@ func valueSortLess(a, b reflect.Value) bool { case reflect.Uintptr: return a.Uint() < b.Uint() case reflect.Array: - // Skip array types that do not support the == operator. - t := a.Type().Elem() - if t.Kind() == reflect.Interface { - t = a.Elem().Type() - } - switch t.Kind() { - case reflect.Slice, reflect.Map, reflect.Func: - goto unsupported - } - // Compare the contents of both arrays. l := a.Len() for i := 0; i < l; i++ { @@ -380,8 +370,6 @@ func valueSortLess(a, b reflect.Value) bool { } return false } - -unsupported: return a.String() < b.String() }