From 77199944fe2d188e18e994009605ee69211920a3 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 80a676f..cce2184 100644 --- a/src/process/Command.Execute.cs +++ b/src/process/Command.Execute.cs @@ -73,15 +73,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() {