From e6ad515315295de010e8ca005962f356a82522ef Mon Sep 17 00:00:00 2001 From: xiangpengzhao Date: Tue, 7 Nov 2017 11:06:54 +0800 Subject: [PATCH] Use "==" instead of DeepEqual for simple structs comparing. --- pkg/registry/core/service/rest.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/registry/core/service/rest.go b/pkg/registry/core/service/rest.go index 4a778d30ee0..341411f73c1 100644 --- a/pkg/registry/core/service/rest.go +++ b/pkg/registry/core/service/rest.go @@ -22,7 +22,6 @@ import ( "net" "net/http" "net/url" - "reflect" "strconv" "github.com/golang/glog" @@ -461,7 +460,7 @@ func containsNumber(haystack []int, needle int) bool { // so small that we expect a linear search to be faster func containsNodePort(serviceNodePorts []ServiceNodePort, serviceNodePort ServiceNodePort) bool { for _, snp := range serviceNodePorts { - if reflect.DeepEqual(snp, serviceNodePort) { + if snp == serviceNodePort { return true } }