Skip to content

Commit a5f9006

Browse files
committed
One last Linq place (not all of them)
1 parent ae7111e commit a5f9006

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

BinaryObjectScanner/Scanner.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using System.IO;
4-
using System.Linq;
54
using BinaryObjectScanner.Data;
65
using BinaryObjectScanner.FileType;
76
using BinaryObjectScanner.Interfaces;
@@ -100,7 +99,7 @@ public ProtectionDictionary GetProtections(List<string>? paths)
10099
if (Directory.Exists(path))
101100
{
102101
// Enumerate all files at first for easier access
103-
var files = IOExtensions.SafeGetFiles(path, "*", SearchOption.AllDirectories).ToList();
102+
List<string> files = [.. IOExtensions.SafeGetFiles(path, "*", SearchOption.AllDirectories)];
104103

105104
// Scan for path-detectable protections
106105
if (_options.ScanPaths)
@@ -113,7 +112,7 @@ public ProtectionDictionary GetProtections(List<string>? paths)
113112
for (int i = 0; i < files.Count; i++)
114113
{
115114
// Get the current file
116-
string file = files.ElementAt(i);
115+
string file = files[i];
117116

118117
// Get the reportable file name
119118
string reportableFileName = file;

0 commit comments

Comments
 (0)