From 6d826afac5549bef03f7d0271bb6f97e949eb1e6 Mon Sep 17 00:00:00 2001 From: lifenjoiner Date: Thu, 6 Apr 2023 20:22:21 +0800 Subject: [PATCH] Reduce a local variable (#2363) --- dnscrypt-proxy/xtransport.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dnscrypt-proxy/xtransport.go b/dnscrypt-proxy/xtransport.go index 9db1ef4f..4a292593 100644 --- a/dnscrypt-proxy/xtransport.go +++ b/dnscrypt-proxy/xtransport.go @@ -280,13 +280,11 @@ func (xTransport *XTransport) rebuildTransport() { if err != nil { return nil, err } - var udpConn *net.UDPConn if xTransport.h3UDPConn == nil { - udpConn, err = net.ListenUDP("udp", &net.UDPAddr{IP: net.IPv4zero, Port: 0}) + xTransport.h3UDPConn, err = net.ListenUDP("udp", &net.UDPAddr{IP: net.IPv4zero, Port: 0}) if err != nil { return nil, err } - xTransport.h3UDPConn = udpConn } return quic.DialEarlyContext(ctx, xTransport.h3UDPConn, udpAddr, host, tlsCfg, cfg) }}