mirror of
https://github.com/2dust/v2rayN.git
synced 2026-02-18 08:13:02 +00:00
Adjust GroupProfileManager
This commit is contained in:
parent
6167624443
commit
54608ab2b9
1 changed files with 9 additions and 8 deletions
|
|
@ -12,7 +12,7 @@ public class GroupProfileManager
|
|||
return await HasCycle(indexId, extraInfo, new HashSet<string>(), new HashSet<string>());
|
||||
}
|
||||
|
||||
public static async Task<bool> HasCycle(string? indexId, ProtocolExtraItem? extraInfo, HashSet<string> visited, HashSet<string> stack)
|
||||
private static async Task<bool> HasCycle(string? indexId, ProtocolExtraItem? extraInfo, HashSet<string> visited, HashSet<string> stack)
|
||||
{
|
||||
if (indexId.IsNullOrEmpty() || extraInfo == null)
|
||||
{
|
||||
|
|
@ -75,20 +75,21 @@ public class GroupProfileManager
|
|||
return (await GetChildProfileItemsByProtocolExtra(protocolExtra), protocolExtra);
|
||||
}
|
||||
|
||||
public static async Task<List<ProfileItem>> GetChildProfileItemsByProtocolExtra(ProtocolExtraItem? protocolExtra)
|
||||
private static async Task<List<ProfileItem>> GetChildProfileItemsByProtocolExtra(ProtocolExtraItem? protocolExtra)
|
||||
{
|
||||
if (protocolExtra == null)
|
||||
{
|
||||
return new();
|
||||
}
|
||||
var items = await GetSelectedChildProfileItems(protocolExtra);
|
||||
var subItems = await GetSubChildProfileItems(protocolExtra);
|
||||
items.AddRange(subItems);
|
||||
|
||||
var items = new List<ProfileItem>();
|
||||
items.AddRange(await GetSubChildProfileItems(protocolExtra));
|
||||
items.AddRange(await GetSelectedChildProfileItems(protocolExtra));
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
public static async Task<List<ProfileItem>> GetSelectedChildProfileItems(ProtocolExtraItem? extra)
|
||||
private static async Task<List<ProfileItem>> GetSelectedChildProfileItems(ProtocolExtraItem? extra)
|
||||
{
|
||||
if (extra == null || extra.ChildItems.IsNullOrEmpty())
|
||||
{
|
||||
|
|
@ -105,10 +106,10 @@ public class GroupProfileManager
|
|||
p.ConfigType != EConfigType.Custom
|
||||
)
|
||||
.ToList();
|
||||
return childProfiles;
|
||||
return childProfiles ?? new();
|
||||
}
|
||||
|
||||
public static async Task<List<ProfileItem>> GetSubChildProfileItems(ProtocolExtraItem? extra)
|
||||
private static async Task<List<ProfileItem>> GetSubChildProfileItems(ProtocolExtraItem? extra)
|
||||
{
|
||||
if (extra == null || extra.SubChildItems.IsNullOrEmpty())
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue