Skip to content

Commit 933ca35

Browse files
MichaCMichaC
authored andcommitted
fix benchmark searching logic
1 parent 1cedbbe commit 933ca35

1 file changed

Lines changed: 2 additions & 16 deletions

File tree

benchmark/CDT.Benchmarks/Benchmarks.cs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,9 @@ internal static class BenchmarkInputReader
2020
/// </summary>
2121
public static (List<V2d<double>> Vertices, List<Edge> Edges) Read(string fileName)
2222
{
23-
// Locate the file relative to the benchmark executable or the repo
24-
string[] searchDirs =
25-
[
26-
AppContext.BaseDirectory,
27-
Path.Combine(AppContext.BaseDirectory, "inputs"),
28-
Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..",
29-
"test", "CDT.Tests", "inputs"),
30-
];
31-
32-
string? path = null;
33-
foreach (var dir in searchDirs)
34-
{
35-
var candidate = Path.Combine(dir, fileName);
36-
if (File.Exists(candidate)) { path = candidate; break; }
37-
}
23+
var path = Path.Combine(AppContext.BaseDirectory, "inputs", fileName);
3824

39-
if (path is null)
25+
if (!File.Exists(path))
4026
throw new FileNotFoundException($"Benchmark input file not found: {fileName}");
4127

4228
using var sr = new StreamReader(path);

0 commit comments

Comments
 (0)