mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-02 10:35:00 +03:00
允许设置去重保留较早或较晚的项
This commit is contained in:
@@ -320,10 +320,10 @@ namespace v2rayN
|
||||
return $"{string.Format("{0:f1}", result)} {unit}";
|
||||
}
|
||||
|
||||
public static void DedupServerList(List<Mode.VmessItem> source, out List<Mode.VmessItem> result)
|
||||
public static void DedupServerList(List<Mode.VmessItem> source, out List<Mode.VmessItem> result, bool keepOlder)
|
||||
{
|
||||
var list = new List<Mode.VmessItem>();
|
||||
source.Reverse(); // Remove the early items first
|
||||
if (!keepOlder) source.Reverse(); // Remove the early items first
|
||||
|
||||
bool _isAdded(Mode.VmessItem o, Mode.VmessItem n)
|
||||
{
|
||||
@@ -348,7 +348,7 @@ namespace v2rayN
|
||||
list.Add(item);
|
||||
}
|
||||
}
|
||||
list.Reverse();
|
||||
if (!keepOlder) list.Reverse();
|
||||
result = list;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user