From a75bc15f29b403e3b538e3e18ae5e1e395b8b86f Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Wed, 15 Mar 2023 14:21:02 -0400 Subject: [PATCH] Update IPathCheck helper a bit --- BurnOutSharp/Handler.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/BurnOutSharp/Handler.cs b/BurnOutSharp/Handler.cs index e77115ac..2eaf22fb 100644 --- a/BurnOutSharp/Handler.cs +++ b/BurnOutSharp/Handler.cs @@ -166,7 +166,7 @@ namespace BurnOutSharp { var subProtections = checkClass.PerformCheck(path, files); if (subProtections != null) - AppendToDictionary(protections, subProtections); + AppendToDictionary(protections, path, subProtections); }); return protections; @@ -321,14 +321,14 @@ namespace BurnOutSharp /// IPathCheck class representing the file type /// Path of the file or directory to check /// Set of protections in path, null on error - private static ConcurrentDictionary> PerformCheck(this IPathCheck impl, string path, IEnumerable files) + private static ConcurrentQueue PerformCheck(this IPathCheck impl, string path, IEnumerable files) { // If we have an invalid path if (string.IsNullOrWhiteSpace(path)) return null; // Setup the output dictionary - var protections = new ConcurrentDictionary>(); + var protections = new ConcurrentQueue(); // If we have a file path if (File.Exists(path)) @@ -336,7 +336,7 @@ namespace BurnOutSharp string protection = impl.CheckFilePath(path); var subProtections = ProcessProtectionString(protection); if (subProtections != null) - AppendToDictionary(protections, path, subProtections); + protections.AddRange(subProtections); } // If we have a directory path @@ -344,7 +344,7 @@ namespace BurnOutSharp { var subProtections = impl.CheckDirectoryPath(path, files); if (subProtections != null) - AppendToDictionary(protections, path, subProtections); + protections.AddRange(subProtections); } return protections;