Skip to content

Commit 2a52168

Browse files
authored
Remove HostString.Port string alloc in HostString.cs (#19082)
#19064
1 parent 47a7fe9 commit 2a52168

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Http/Http.Abstractions/src/HostString.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public int? Port
9696
GetParts(_value, out var host, out var port);
9797

9898
if (!StringSegment.IsNullOrEmpty(port)
99-
&& int.TryParse(port.ToString(), NumberStyles.None, CultureInfo.InvariantCulture, out var p))
99+
&& int.TryParse(port.AsSpan(), NumberStyles.None, CultureInfo.InvariantCulture, out var p))
100100
{
101101
return p;
102102
}

0 commit comments

Comments
 (0)