Skip to content

Commit

Permalink
Remove nullable from benchmark test
Browse files Browse the repository at this point in the history
  • Loading branch information
neilharvey committed Feb 20, 2022
1 parent 76c6886 commit 3554397
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ public class FileFormatInspectorBenchmarks

static FileFormatInspectorBenchmarks()
{
#nullable disable warnings
var buildDirectoryPath = Path.GetDirectoryName(typeof(FunctionalTests).Assembly.Location);
samplesPath = Path.Combine(buildDirectoryPath ?? "", "Samples");
#nullable enable warnings
samplesPath = Path.Combine(buildDirectoryPath, "Samples");
}

public FileFormatInspectorBenchmarks()
Expand All @@ -33,7 +31,7 @@ public static IEnumerable<string> SampleFiles()

return samplesDirectory
.GetFiles()
.Where(x => x.LastWriteTime.Year == 2022)
//.Where(x => x.Extension == ".xls")
.Select(x => x.Name)
.ToList();
}
Expand All @@ -43,7 +41,7 @@ public FileFormat DetermineFileFormat()
{
// We must open the stream as part of the benchmark because otherwise
// Windows anti-malware will get rather upset with us.
using var stream = System.IO.File.OpenRead(Path.Combine(samplesPath, FileName));
using var stream = File.OpenRead(Path.Combine(samplesPath, FileName));
return inspector.DetermineFileFormat(stream);
}
}
Expand Down

0 comments on commit 3554397

Please sign in to comment.