Code clean (#9482)

This commit is contained in:
DHR60
2026-06-06 03:20:06 +00:00
committed by GitHub
parent 4dc9c60b85
commit e6d08c2db1
58 changed files with 169 additions and 217 deletions
@@ -69,7 +69,7 @@ public class ClashConnectionsViewModel : MyReactiveObject
var dtNow = DateTime.Now;
var lstModel = new List<ClashConnectionModel>();
foreach (var item in connections ?? new())
foreach (var item in connections ?? [])
{
var host = $"{(item.metadata.host.IsNullOrEmpty() ? item.metadata.destinationIP : item.metadata.host)}:{item.metadata.destinationPort}";
if (HostFilter.IsNotEmpty() && !host.Contains(HostFilter))
@@ -85,7 +85,7 @@ public class ClashConnectionsViewModel : MyReactiveObject
Host = host,
Time = (dtNow - item.start).TotalSeconds < 0 ? 1 : (dtNow - item.start).TotalSeconds,
Elapsed = (dtNow - item.start).ToString(@"hh\:mm\:ss"),
Chain = $"{item.rule} , {string.Join("->", item.chains ?? new())}"
Chain = $"{item.rule} , {string.Join("->", item.chains ?? [])}"
};
lstModel.Add(model);