统计列后续纠正,及代码优化

pull/453/head
YFdyh000 5 years ago
parent 31fb479459
commit c4c05bfafd

@ -198,13 +198,13 @@ namespace v2rayN.Forms
ListViewItem lvItem = null; ListViewItem lvItem = null;
if (statistics != null && statistics.Enable) if (statistics != null && statistics.Enable)
{ {
var index = statistics.Statistic.FindIndex(item_ => item_.itemId == item.getItemId()); var sItem = statistics.Statistic.Find(item_ => item_.itemId == item.getItemId());
if (index != -1) if (sItem != null)
{ {
totalUp = Utils.HumanFy(statistics.Statistic[index].totalUp); totalUp = Utils.HumanFy(sItem.totalUp);
totalDown = Utils.HumanFy(statistics.Statistic[index].totalDown); totalDown = Utils.HumanFy(sItem.totalDown);
todayUp = Utils.HumanFy(statistics.Statistic[index].todayUp); todayUp = Utils.HumanFy(sItem.todayUp);
todayDown = Utils.HumanFy(statistics.Statistic[index].todayDown); todayDown = Utils.HumanFy(sItem.todayDown);
} }
lvItem = new ListViewItem(new string[] lvItem = new ListViewItem(new string[]
@ -220,10 +220,10 @@ namespace v2rayN.Forms
item.network, item.network,
item.getSubRemarks(config), item.getSubRemarks(config),
item.testResult, item.testResult,
totalUp, todayDown,
totalDown,
todayUp, todayUp,
todayDown totalDown,
totalUp
}); });
} }
else else
@ -241,10 +241,6 @@ namespace v2rayN.Forms
item.network, item.network,
item.getSubRemarks(config), item.getSubRemarks(config),
item.testResult item.testResult
//totalUp,
//totalDown,
//todayUp,
//todayDown,
}); });
} }

Loading…
Cancel
Save