From 046421f34547451e200a3725b2e90dc2b16d2ae3 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Sat, 2 Nov 2024 14:42:01 +0800 Subject: [PATCH] Code clean --- v2rayN/ServiceLib/Services/UpdateService.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/v2rayN/ServiceLib/Services/UpdateService.cs b/v2rayN/ServiceLib/Services/UpdateService.cs index 5a430a9c..1a8e8d64 100644 --- a/v2rayN/ServiceLib/Services/UpdateService.cs +++ b/v2rayN/ServiceLib/Services/UpdateService.cs @@ -6,12 +6,10 @@ namespace ServiceLib.Services public class UpdateService { private Action? _updateFunc; - private Config _config; private int _timeout = 30; public async Task CheckUpdateGuiN(Config config, Action updateFunc, bool preRelease) { - _config = config; _updateFunc = updateFunc; var url = string.Empty; var fileName = string.Empty; @@ -53,7 +51,6 @@ namespace ServiceLib.Services public async Task CheckUpdateCore(ECoreType type, Config config, Action updateFunc, bool preRelease) { - _config = config; _updateFunc = updateFunc; var url = string.Empty; var fileName = string.Empty; @@ -108,7 +105,6 @@ namespace ServiceLib.Services public async Task UpdateSubscriptionProcess(Config config, string subId, bool blProxy, Action updateFunc) { - _config = config; _updateFunc = updateFunc; _updateFunc?.Invoke(false, ResUI.MsgUpdateSubscriptionStart); @@ -454,7 +450,6 @@ namespace ServiceLib.Services private async Task UpdateGeoFile(string geoName, Config config, Action updateFunc) { - _config = config; _updateFunc = updateFunc; var geoUrl = string.IsNullOrEmpty(config?.ConstItem.GeoSourceUrl) @@ -470,7 +465,6 @@ namespace ServiceLib.Services private async Task UpdateSrsFileAll(Config config, Action updateFunc) { - _config = config; _updateFunc = updateFunc; var geoipFiles = new List(); @@ -521,9 +515,9 @@ namespace ServiceLib.Services private async Task UpdateSrsFile(string type, string srsName, Config config, Action updateFunc) { - var srsUrl = string.IsNullOrEmpty(_config.ConstItem.SrsSourceUrl) + var srsUrl = string.IsNullOrEmpty(config.ConstItem.SrsSourceUrl) ? Global.SingboxRulesetUrl - : _config.ConstItem.SrsSourceUrl; + : config.ConstItem.SrsSourceUrl; var fileName = $"{type}-{srsName}.srs"; var targetPath = Path.Combine(Utils.GetBinPath("srss"), fileName);