mirror of
https://github.com/2dust/v2rayN.git
synced 2025-05-02 13:18:50 +00:00
Merge pull request #5066 from sincereliu/master
Optimize code for better performance
This commit is contained in:
commit
e223b80b95
1 changed files with 3 additions and 12 deletions
|
@ -266,19 +266,10 @@ namespace v2rayN.Handler
|
||||||
{
|
{
|
||||||
if (Utils.IsIpv6(address))
|
if (Utils.IsIpv6(address))
|
||||||
{
|
{
|
||||||
if (address.StartsWith('[') && address.EndsWith(']'))
|
// 检查地址是否已经被方括号包围,如果没有,则添加方括号
|
||||||
{
|
return address.StartsWith('[') && address.EndsWith(']') ? address : $"[{address}]";
|
||||||
return address;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return $"[{address}]";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return address;
|
|
||||||
}
|
}
|
||||||
|
return address; // 如果不是IPv6地址,直接返回原地址
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int GetStdTransport(ProfileItem item, string? securityDef, ref Dictionary<string, string> dicQuery)
|
private static int GetStdTransport(ProfileItem item, string? securityDef, ref Dictionary<string, string> dicQuery)
|
||||||
|
|
Loading…
Reference in a new issue