AI-optimized code

This commit is contained in:
2dust
2025-03-06 10:57:39 +08:00
parent 23b27575a0
commit d4a8787356
10 changed files with 57 additions and 34 deletions
+5 -3
View File
@@ -24,9 +24,9 @@ namespace ServiceLib.Handler.Fmt
public static string? ToUri(ProfileItem? item)
{
if (item == null)
{
return null;
var url = string.Empty;
}
var remark = string.Empty;
if (item.Remarks.IsNotEmpty())
{
@@ -77,7 +77,7 @@ namespace ServiceLib.Handler.Fmt
return null;
}
item.Address = arr1[1][..indexPort];
item.Port = (arr1[1][(indexPort + 1)..]).ToInt();
item.Port = arr1[1][(indexPort + 1)..].ToInt();
item.Security = arr21.First();
item.Id = arr21[1];
@@ -88,7 +88,9 @@ namespace ServiceLib.Handler.Fmt
{
var parsedUrl = Utils.TryUri(result);
if (parsedUrl == null)
{
return null;
}
ProfileItem item = new()
{