From b4765f782d91443ab0415dc00e727d783632e2ad Mon Sep 17 00:00:00 2001 From: Ian Gudger Date: Tue, 8 May 2018 09:51:07 -0700 Subject: Fix warning: redundant if ...; err != nil check, just return error instead. This warning is produced by golint. PiperOrigin-RevId: 195833381 Change-Id: Idd6a7e57e3cfdf00819f2374b19fc113585dc1e1 --- pkg/tcpip/stack/transport_demuxer.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'pkg/tcpip/stack/transport_demuxer.go') diff --git a/pkg/tcpip/stack/transport_demuxer.go b/pkg/tcpip/stack/transport_demuxer.go index 3c0d7aa31..7bb853622 100644 --- a/pkg/tcpip/stack/transport_demuxer.go +++ b/pkg/tcpip/stack/transport_demuxer.go @@ -158,9 +158,5 @@ func (d *transportDemuxer) findEndpointLocked(eps *transportEndpoints, vv *buffe // Try to find a match with only the local port. nid.LocalAddress = "" - if ep := eps.endpoints[nid]; ep != nil { - return ep - } - - return nil + return eps.endpoints[nid] } -- cgit v1.2.3