mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-04-13 20:28:32 +10:00
Simplify slice to array conversion
This commit is contained in:
@@ -26,7 +26,7 @@ func defaultRouteIP() (netip.Addr, error) {
|
||||
for _, addr := range addrs {
|
||||
ip := addr.(*net.IPNet).IP
|
||||
if ip.To4() != nil {
|
||||
return netip.AddrFrom4(*(*[4]byte)(ip)), nil
|
||||
return netip.AddrFrom4([4]byte(ip)), nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user