@@ -24,11 +24,11 @@ public class IPAddress
2424
2525 internal const uint LoopbackMaskHostOrder = 0xFF000000 ;
2626
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 ;
3030
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 ) ;
3232
3333 /// <summary>
3434 /// For IPv4 addresses, this field stores the Address.
@@ -644,7 +644,7 @@ public IPAddress MapToIPv4()
644644
645645 private sealed class ReadOnlyIPAddress : IPAddress
646646 {
647- public ReadOnlyIPAddress ( byte [ ] newAddress ) : base ( newAddress )
647+ public ReadOnlyIPAddress ( ReadOnlySpan < byte > newAddress ) : base ( newAddress )
648648 { }
649649 }
650650 }
0 commit comments