From 5d3bc89a155c8f3fbe9ef1115c84ae62214f349d Mon Sep 17 00:00:00 2001 From: chryzsh Date: Fri, 28 Aug 2026 09:57:31 +0200 Subject: [PATCH] Use EnumerateDirectories in local triage cache walk Maintainer-requested in #61: swap the eager Directory.GetDirectories() call for Directory.EnumerateDirectories() in the recursive local triage cache walk, so recursion into the first child directory can begin without first materializing the full array of siblings. Same traversal order and output, no behavior change. --- lib/ClientFileSystem.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ClientFileSystem.cs b/lib/ClientFileSystem.cs index e2a8be5..8995335 100644 --- a/lib/ClientFileSystem.cs +++ b/lib/ClientFileSystem.cs @@ -82,7 +82,7 @@ public static void GetDirectoryContentsAndPermissions(string dirPath, bool recur } if (recurse) { - foreach (string subdirPath in Directory.GetDirectories(dirPath)) + foreach (string subdirPath in Directory.EnumerateDirectories(dirPath)) { GetDirectoryContentsAndPermissions(subdirPath, true); } @@ -205,4 +205,4 @@ public static void Triage() Console.WriteLine(); } } -} \ No newline at end of file +}