File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
src/Middleware/HttpOverrides/src Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change 33
44using System . Diagnostics . CodeAnalysis ;
55using System . Net ;
6- using System . Net . Sockets ;
76
87namespace Microsoft . AspNetCore . HttpOverrides ;
98
@@ -56,10 +55,7 @@ public IPNetwork(IPAddress prefix, int prefixLength)
5655 /// <exception cref="FormatException"><paramref name="networkSpan"/> is not in the correct format.</exception>
5756 /// <exception cref="ArgumentOutOfRangeException">The prefix length contained in <paramref name="networkSpan"/> is out of range.</exception>
5857 /// <inheritdoc cref="TryParseComponents(ReadOnlySpan{char}, out IPAddress?, out int)"/>
59- public static IPNetwork Parse ( ReadOnlySpan < char > networkSpan )
60- {
61- return System . Net . IPNetwork . Parse ( networkSpan ) ;
62- }
58+ public static IPNetwork Parse ( ReadOnlySpan < char > networkSpan ) => System . Net . IPNetwork . Parse ( networkSpan ) ;
6359
6460 /// <summary>
6561 /// Converts the specified <see cref="ReadOnlySpan{T}"/> of <see langword="char"/> representation of
@@ -81,18 +77,16 @@ public static bool TryParse(ReadOnlySpan<char> networkSpan, [NotNullWhen(true)]
8177 {
8278 if ( System . Net . IPNetwork . TryParse ( networkSpan , out var ipNetwork ) )
8379 {
84- network = ipNetwork ;
80+ network = new ( ipNetwork ) ;
8581 return true ;
8682 }
8783
84+ network = null ;
8885 return false ;
8986 }
9087
9188 /// <summary>
9289 /// Convert <see cref="System.Net.IPNetwork" /> to <see cref="Microsoft.AspNetCore.HttpOverrides.IPNetwork" /> implicitly
9390 /// </summary>
94- public static implicit operator IPNetwork ( System . Net . IPNetwork ipNetwork )
95- {
96- return new IPNetwork ( ipNetwork ) ;
97- }
91+ public static implicit operator IPNetwork ( System . Net . IPNetwork ipNetwork ) => new IPNetwork ( ipNetwork ) ;
9892}
You can’t perform that action at this time.
0 commit comments