@@ -24,11 +24,11 @@ public class IPAddress
24
24
25
25
internal const uint LoopbackMaskHostOrder = 0xFF000000 ;
26
26
27
- public static readonly IPAddress IPv6Any = new IPAddress ( new byte [ ] { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } , 0 ) ;
28
- public static readonly IPAddress IPv6Loopback = new IPAddress ( new byte [ ] { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 } , 0 ) ;
29
- public static readonly IPAddress IPv6None = new IPAddress ( new byte [ ] { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } , 0 ) ;
27
+ public static readonly IPAddress IPv6Any = new IPAddress ( ( ReadOnlySpan < byte > ) new byte [ ] { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } , 0 ) ;
28
+ public static readonly IPAddress IPv6Loopback = new IPAddress ( ( ReadOnlySpan < byte > ) new byte [ ] { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 } , 0 ) ;
29
+ public static readonly IPAddress IPv6None = IPv6Any ;
30
30
31
- private static readonly IPAddress s_loopbackMappedToIPv6 = new IPAddress ( new byte [ ] { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 255 , 255 , 127 , 0 , 0 , 1 } , 0 ) ;
31
+ private static readonly IPAddress s_loopbackMappedToIPv6 = new IPAddress ( ( ReadOnlySpan < byte > ) new byte [ ] { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 255 , 255 , 127 , 0 , 0 , 1 } , 0 ) ;
32
32
33
33
/// <summary>
34
34
/// For IPv4 addresses, this field stores the Address.
@@ -644,7 +644,7 @@ public IPAddress MapToIPv4()
644
644
645
645
private sealed class ReadOnlyIPAddress : IPAddress
646
646
{
647
- public ReadOnlyIPAddress ( byte [ ] newAddress ) : base ( newAddress )
647
+ public ReadOnlyIPAddress ( ReadOnlySpan < byte > newAddress ) : base ( newAddress )
648
648
{ }
649
649
}
650
650
}
0 commit comments