From a5f9006ef133cf8a733e043e4ece60c731b764b6 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 15 Nov 2024 23:09:58 -0500 Subject: [PATCH] One last Linq place (not all of them) --- BinaryObjectScanner/Scanner.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/BinaryObjectScanner/Scanner.cs b/BinaryObjectScanner/Scanner.cs index bfa8c02b..bed0d840 100644 --- a/BinaryObjectScanner/Scanner.cs +++ b/BinaryObjectScanner/Scanner.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using BinaryObjectScanner.Data; using BinaryObjectScanner.FileType; using BinaryObjectScanner.Interfaces; @@ -100,7 +99,7 @@ namespace BinaryObjectScanner if (Directory.Exists(path)) { // Enumerate all files at first for easier access - var files = IOExtensions.SafeGetFiles(path, "*", SearchOption.AllDirectories).ToList(); + List files = [.. IOExtensions.SafeGetFiles(path, "*", SearchOption.AllDirectories)]; // Scan for path-detectable protections if (_options.ScanPaths) @@ -113,7 +112,7 @@ namespace BinaryObjectScanner for (int i = 0; i < files.Count; i++) { // Get the current file - string file = files.ElementAt(i); + string file = files[i]; // Get the reportable file name string reportableFileName = file;