Remove HostString.Port string alloc in HostString.cs (#19082)
https://github.com/dotnet/aspnetcore/issues/19064
This commit is contained in:
parent
47a7fe9bea
commit
2a52168115
|
|
@ -96,7 +96,7 @@ namespace Microsoft.AspNetCore.Http
|
|||
GetParts(_value, out var host, out var port);
|
||||
|
||||
if (!StringSegment.IsNullOrEmpty(port)
|
||||
&& int.TryParse(port.ToString(), NumberStyles.None, CultureInfo.InvariantCulture, out var p))
|
||||
&& int.TryParse(port.AsSpan(), NumberStyles.None, CultureInfo.InvariantCulture, out var p))
|
||||
{
|
||||
return p;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue