Skip to content

Commit 568f54f

Browse files
authored
Reduce comparisons (#2148)
1 parent dc2fff0 commit 568f54f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

dnscrypt-proxy/crypto.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,9 @@ func (proxy *Proxy) Encrypt(
106106
minQuestionSize += int(xpad[0])
107107
}
108108
paddedLength := Min(MaxDNSUDPPacketSize, (Max(minQuestionSize, QueryOverhead)+1+63) & ^63)
109-
if proto == "udp" && serverInfo.knownBugs.fragmentsBlocked {
109+
if serverInfo.knownBugs.fragmentsBlocked && proto == "udp" {
110110
paddedLength = MaxDNSUDPSafePacketSize
111-
}
112-
if serverInfo.Relay != nil && proto == "tcp" {
111+
} else if serverInfo.Relay != nil && proto == "tcp" {
113112
paddedLength = MaxDNSPacketSize
114113
}
115114
if QueryOverhead+len(packet)+1 > paddedLength {

0 commit comments

Comments
 (0)