Pull request: 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
82505566f8
commit
3603b1fcab
|
@ -333,8 +333,14 @@ type tcpPort int
|
||||||
// ports should be either a udpPort or a tcpPort.
|
// ports should be either a udpPort or a tcpPort.
|
||||||
func addPorts(uc aghalg.UniqChecker, ports ...interface{}) {
|
func addPorts(uc aghalg.UniqChecker, ports ...interface{}) {
|
||||||
for _, p := range ports {
|
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) {
|
switch p := p.(type) {
|
||||||
case tcpPort, udpPort:
|
case tcpPort:
|
||||||
|
if p != 0 {
|
||||||
|
uc.Add(p)
|
||||||
|
}
|
||||||
|
case udpPort:
|
||||||
if p != 0 {
|
if p != 0 {
|
||||||
uc.Add(p)
|
uc.Add(p)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue