@@ -191,7 +191,7 @@ internal static Attach CreateAttach(string? address,
191191 {
192192 return PercentCodec . EncodePathSegment ( url ) ;
193193 }
194-
194+
195195 internal static string ? DecodePathSegment ( string url )
196196 {
197197 return PercentCodec . DecodePathSegment ( url ) ;
@@ -379,7 +379,7 @@ static PercentCodec()
379379 s_unreserved [ '_' ] = true ;
380380 s_unreserved [ '~' ] = true ;
381381 }
382-
382+
383383 private static int HexValue ( char ch )
384384 {
385385 return ch switch
@@ -391,14 +391,13 @@ private static int HexValue(char ch)
391391 } ;
392392 }
393393
394-
395394 internal static string ? DecodePathSegment ( string ? segment )
396395 {
397396 if ( segment == null )
398397 {
399398 return null ;
400399 }
401-
400+
402401 var bytes = new List < byte > ( segment . Length ) ;
403402 for ( int i = 0 ; i < segment . Length ; i ++ )
404403 {
@@ -409,14 +408,14 @@ private static int HexValue(char ch)
409408 {
410409 throw new FormatException ( "Invalid percent-encoding: incomplete escape sequence." ) ;
411410 }
412-
411+
413412 int hi = HexValue ( segment [ i + 1 ] ) ;
414413 int lo = HexValue ( segment [ i + 2 ] ) ;
415414 if ( hi < 0 || lo < 0 )
416415 {
417416 throw new FormatException ( $ "Invalid percent-encoding: '{ segment . Substring ( i , 3 ) } '.") ;
418417 }
419-
418+
420419 bytes . Add ( ( byte ) ( ( hi << 4 ) | lo ) ) ;
421420 i += 2 ;
422421 }
@@ -433,12 +432,10 @@ private static int HexValue(char ch)
433432 }
434433 }
435434 }
436-
435+
437436 return Encoding . UTF8 . GetString ( bytes . ToArray ( ) ) ;
438437 }
439-
440-
441-
438+
442439 internal static string ? EncodePathSegment ( string ? segment )
443440 {
444441 if ( segment == null )
0 commit comments