mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-11-16 02:18:28 -07:00
cherry-pick: home: fix types
Updates #4424. Squashed commit of the following: commit 784b4940d46ce74edbfbbde6e5b24f95dcb4bc70 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Mar 24 17:07:41 2022 +0300 home: fix types
This commit is contained in:
parent
d27c3284f6
commit
b114fd5279
@ -332,8 +332,14 @@ type tcpPort int
|
||||
// ports should be either a udpPort or a tcpPort.
|
||||
func addPorts(uc aghalg.UniqChecker, ports ...interface{}) {
|
||||
for _, p := range ports {
|
||||
// Use separate cases for tcpPort and udpPort so that the untyped
|
||||
// constant zero is converted to the appropriate type.
|
||||
switch p := p.(type) {
|
||||
case tcpPort, udpPort:
|
||||
case tcpPort:
|
||||
if p != 0 {
|
||||
uc.Add(p)
|
||||
}
|
||||
case udpPort:
|
||||
if p != 0 {
|
||||
uc.Add(p)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user