From 1b9b5284bd7a5de947fc98c1c8252bf8abe174ac Mon Sep 17 00:00:00 2001 From: Louis Seubert Date: Tue, 25 Aug 2026 19:46:07 +0200 Subject: [PATCH] chore: tidy up windows path resolution syntax --- src/process/Command.Execute.cs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/process/Command.Execute.cs b/src/process/Command.Execute.cs index df140aa..09f99d0 100644 --- a/src/process/Command.Execute.cs +++ b/src/process/Command.Execute.cs @@ -75,15 +75,11 @@ public sealed partial class Command return TargetFilePath; } - return ( - from probeDirPath in GetProbeDirectoryPaths() - where Directory.Exists(probeDirPath) - select Path.Combine(probeDirPath, TargetFilePath) - into baseFilePath - from extension in GetPathExtensions() - select Path.ChangeExtension(baseFilePath, extension) - ).FirstOrDefault(File.Exists) ?? - TargetFilePath; + return GetProbeDirectoryPaths() + .Where(Directory.Exists) + .Select(path => Path.Combine(path, TargetFilePath)) + .SelectMany(static _ => GetPathExtensions(), static (path, extension) => Path.ChangeExtension(path, extension)) + .FirstOrDefault(File.Exists) ?? TargetFilePath; static IEnumerable GetProbeDirectoryPaths() { -- 2.52.0