From 63a9e03d897c4604679d2f921262a0a34ecfdb17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Wed, 6 Jan 2021 19:33:55 +0800 Subject: [PATCH] format QueryForPlugin code --- Flow.Launcher.Core/Plugin/PluginManager.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index 5ca6e0aed..5a5ba1971 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -176,8 +176,8 @@ namespace Flow.Launcher.Core.Plugin async () => results = await plugin.QueryAsync(query, token).ConfigureAwait(false)); break; case IPlugin plugin: - await Task.Run(() => milliseconds = Stopwatch.Debug($"|PluginManager.QueryForPlugin|Cost for {metadata.Name}", () => - results = plugin.Query(query)), token).ConfigureAwait(false); + await Task.Run(() => milliseconds = Stopwatch.Debug($"|PluginManager.QueryForPlugin|Cost for {metadata.Name}", + () => results = plugin.Query(query)), token).ConfigureAwait(false); break; default: throw new ArgumentOutOfRangeException(); @@ -192,6 +192,7 @@ namespace Flow.Launcher.Core.Plugin } catch (OperationCanceledException) { + // null will be fine since the results will only be added into queue if the token hasn't been cancelled return results = null; } catch (Exception e) @@ -199,7 +200,6 @@ namespace Flow.Launcher.Core.Plugin Log.Exception($"|PluginManager.QueryForPlugin|Exception for plugin <{pair.Metadata.Name}> when query <{query}>", e); } - // null will be fine since the results will only be added into queue if the token hasn't been cancelled return results; }