From 72989af887e0494ab9a125d919473fa7f7f2b387 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Jan 2026 10:40:24 +0000 Subject: [PATCH] Improve code clarity by renaming GetBestMatch parameters Co-authored-by: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> --- .../Flow.Launcher.Plugin.Program/Programs/Win32.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs index ec247cd3b..002a49ca9 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs @@ -98,19 +98,21 @@ namespace Flow.Launcher.Plugin.Program.Programs } /// - /// Returns the best match between localized name and English name when both are available. + /// Returns the best match between the primary display name and the English name when both are available. /// - private MatchResult GetBestMatch(string query, string localizedName, string englishName, bool useLocalizedName) + private MatchResult GetBestMatch(string query, string primaryName, string englishName, bool hasDifferentLocalizedName) { - var localizedMatch = Main.Context.API.FuzzySearch(query, localizedName); + var primaryMatch = Main.Context.API.FuzzySearch(query, primaryName); - if (!useLocalizedName) + // If there's no different localized name, just return the primary match + if (!hasDifferentLocalizedName) { - return localizedMatch; + return primaryMatch; } + // Search the English name as well and return the better match var englishMatch = Main.Context.API.FuzzySearch(query, englishName); - return englishMatch.Score > localizedMatch.Score ? englishMatch : localizedMatch; + return englishMatch.Score > primaryMatch.Score ? englishMatch : primaryMatch; } public Result Result(string query, IPublicAPI api)