Skip to content

Commit 8b95c42

Browse files
committed
minor refactor
1 parent c9d52ff commit 8b95c42

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

GitContentSearch/FileSearcher.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
using NPOI.HPSF;
2-
using NPOI.HSSF.UserModel; // For .xls
1+
using NPOI.HSSF.UserModel; // For .xls
32
using NPOI.SS.UserModel;
43
using NPOI.XSSF.UserModel; // For .xlsx
54

65
namespace GitContentSearch
76
{
8-
public class FileSearcher : IFileSearcher
7+
public class FileSearcher : IFileSearcher
98
{
109
public bool SearchInFile(string fileName, string searchString)
1110
{
@@ -37,7 +36,7 @@ public bool SearchInTextStream(Stream stream, string searchString)
3736
{
3837
stream.Position = 0;
3938
using var reader = new StreamReader(stream);
40-
string line;
39+
string? line;
4140
while ((line = reader.ReadLine()) != null)
4241
{
4342
if (line.Contains(searchString, StringComparison.OrdinalIgnoreCase))
@@ -46,7 +45,7 @@ public bool SearchInTextStream(Stream stream, string searchString)
4645
}
4746
}
4847
}
49-
catch (Exception ex)
48+
catch (Exception)
5049
{
5150
return false;
5251
}

0 commit comments

Comments
 (0)