Remove HostString.Port string alloc in HostString.cs (#19082)

https://github.com/dotnet/aspnetcore/issues/19064
This commit is contained in:
samsosa 2020-02-17 08:07:32 +01:00 committed by GitHub
parent 47a7fe9bea
commit 2a52168115
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}