File tree Expand file tree Collapse file tree 3 files changed +489
-11
lines changed Expand file tree Collapse file tree 3 files changed +489
-11
lines changed Original file line number Diff line number Diff line change @@ -472,17 +472,14 @@ public OwinEntries(HttpContext context)
472472 } ;
473473 }
474474
475- static readonly string [ ] PortStrings = CreatePortStrings ( ) ;
476- static string [ ] CreatePortStrings ( )
475+ static string PortToString ( int port ) => port switch
477476 {
478- var ports = new string [ 65535 ] ; // limit of ephemeral ports https://en.wikipedia.org/wiki/Ephemeral_port
479- for ( var i = 0 ; i < ports . Length ; i ++ )
480- {
481- ports [ i ] = ( i + 1 ) . ToString ( CultureInfo . InvariantCulture ) ;
482- }
483- return ports ;
484- }
485- static string PortToString ( int port ) => PortStrings [ port - 1 ] ;
477+ 80 => "80" ,
478+ 443 => "443" ,
479+ 8080 => "8080" ,
480+ 8081 => "8081" ,
481+ _ => port . ToString ( CultureInfo . InvariantCulture )
482+ } ;
486483
487484 public int Count
488485 {
You can’t perform that action at this time.
0 commit comments