From 18d1bb566898980436b2cc55d6fb71e4541ed04c Mon Sep 17 00:00:00 2001 From: TheBestPessimist Date: Thu, 26 Jan 2023 09:19:42 +0200 Subject: [PATCH] Cleanup unused properties --- .../Search/Everything/EverythingAPI.cs | 47 ++----------------- 1 file changed, 3 insertions(+), 44 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingAPI.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingAPI.cs index 2013ebe4b..3efd09c4d 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingAPI.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingAPI.cs @@ -13,13 +13,12 @@ using Flow.Launcher.Plugin.Explorer.Exceptions; namespace Flow.Launcher.Plugin.Explorer.Search.Everything { - public static class EverythingApi { - private const int BufferSize = 4096; private static SemaphoreSlim _semaphore = new(1, 1); + // cached buffer to remove redundant allocations. private static readonly StringBuilder buffer = new(BufferSize); @@ -35,46 +34,6 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything InvalidCallError } - /// - /// Gets or sets a value indicating whether [match path]. - /// - /// true if [match path]; otherwise, false. - public static bool MatchPath // TODO these seem to be unused, and they're related exactly to the feature i want: make everything search through the whole path. How should these be used? Should they be removed instead? IMHO, it seems better to use full path search by default, so i'd remove this completely - { - get => EverythingApiDllImport.Everything_GetMatchPath(); - set => EverythingApiDllImport.Everything_SetMatchPath(value); - } - - /// - /// Gets or sets a value indicating whether [match case]. - /// - /// true if [match case]; otherwise, false. - public static bool MatchCase - { - get => EverythingApiDllImport.Everything_GetMatchCase(); - set => EverythingApiDllImport.Everything_SetMatchCase(value); - } - - /// - /// Gets or sets a value indicating whether [match whole word]. - /// - /// true if [match whole word]; otherwise, false. - public static bool MatchWholeWord - { - get => EverythingApiDllImport.Everything_GetMatchWholeWord(); - set => EverythingApiDllImport.Everything_SetMatchWholeWord(value); - } - - /// - /// Gets or sets a value indicating whether [enable regex]. - /// - /// true if [enable regex]; otherwise, false. - public static bool EnableRegex - { - get => EverythingApiDllImport.Everything_GetRegex(); - set => EverythingApiDllImport.Everything_SetRegex(value); - } - /// /// Checks whether the sort option is Fast Sort. /// @@ -95,7 +54,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything try { - EverythingApiDllImport.Everything_GetMajorVersion(); + EverythingApiDllImport.Everything_GetMajorVersion(); var result = EverythingApiDllImport.Everything_GetLastError() != StateCode.IPCError; return result; } @@ -122,7 +81,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything await _semaphore.WaitAsync(token); - + try { if (token.IsCancellationRequested)