Remove redundant string operation (#8324)

This commit is contained in:
Harry Huang
2025-11-16 14:21:34 +08:00
committed by GitHub
parent 3f0bcf7b83
commit 4fb41aeca1
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -425,7 +425,7 @@ public class Utils
var domain = authority;
// Handle IPv6 addresses, e.g., "[2001:db8::1]:443"
if (authority.StartsWith("[") && authority.Contains("]"))
if (authority.StartsWith('[') && authority.Contains(']'))
{
var closingBracketIndex = authority.LastIndexOf(']');
if (closingBracketIndex < authority.Length - 1 && authority[closingBracketIndex + 1] == ':')