Use System.Text.Json to replace Newtonsoft.Json for better performance

This commit is contained in:
Jack251970 2025-01-09 20:57:43 +08:00
parent 7cccbb07ac
commit ad0270079d

View file

@ -1,10 +1,9 @@
using Flow.Launcher.Core.ExternalPlugins;
using Flow.Launcher.Infrastructure.UserSettings;
using ICSharpCode.SharpZipLib.Zip;
using Newtonsoft.Json;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text.Json;
namespace Flow.Launcher.Plugin.PluginsManager
{
@ -72,12 +71,10 @@ namespace Flow.Launcher.Plugin.PluginsManager
if (pluginJsonEntry != null)
{
using (StreamReader reader = new StreamReader(pluginJsonEntry.Open()))
{
string pluginJsonContent = reader.ReadToEnd();
plugin = JsonConvert.DeserializeObject<UserPlugin>(pluginJsonContent);
plugin.IcoPath = "Images\\zipfolder.png";
}
using StreamReader reader = new StreamReader(pluginJsonEntry.Open());
string pluginJsonContent = reader.ReadToEnd();
plugin = JsonSerializer.Deserialize<UserPlugin>(pluginJsonContent);
plugin.IcoPath = "Images\\zipfolder.png";
}
}