Skip to content

Commit 5f4d24a

Browse files
authored
Merge pull request #3174 from Jack251970/dev1
Use System.Text.Json to replace Newtonsoft.Json for better performance
2 parents f1746b0 + 95b4c4c commit 5f4d24a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

Plugins/Flow.Launcher.Plugin.PluginsManager/Utilities.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
using Flow.Launcher.Core.ExternalPlugins;
2-
using Flow.Launcher.Infrastructure.UserSettings;
32
using ICSharpCode.SharpZipLib.Zip;
4-
using Newtonsoft.Json;
53
using System.IO;
64
using System.IO.Compression;
75
using System.Linq;
6+
using System.Text.Json;
87

98
namespace Flow.Launcher.Plugin.PluginsManager
109
{
@@ -72,12 +71,9 @@ internal static UserPlugin GetPluginInfoFromZip(string filePath)
7271

7372
if (pluginJsonEntry != null)
7473
{
75-
using (StreamReader reader = new StreamReader(pluginJsonEntry.Open()))
76-
{
77-
string pluginJsonContent = reader.ReadToEnd();
78-
plugin = JsonConvert.DeserializeObject<UserPlugin>(pluginJsonContent);
79-
plugin.IcoPath = "Images\\zipfolder.png";
80-
}
74+
using Stream stream = pluginJsonEntry.Open();
75+
plugin = JsonSerializer.Deserialize<UserPlugin>(stream);
76+
plugin.IcoPath = "Images\\zipfolder.png";
8177
}
8278
}
8379

0 commit comments

Comments
 (0)