Skip to content

Commit e10b154

Browse files
committed
Extract const
1 parent 736a58b commit e10b154

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/BenchmarkDotNet/Running/BuildPartition.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,18 @@ internal static string GetProgramName(BenchmarkCase representativeBenchmarkCase,
9191
// Very long program name can cause the path to exceed Windows' 260 character limit,
9292
// for example BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks.
9393
// 36 is an arbitrary limit, but it's the length of Guid strings which is what was used previously.
94-
if (!OsDetector.IsWindows() || programName.Length <= 36)
94+
const int MaxLength = 36;
95+
if (!OsDetector.IsWindows() || programName.Length <= MaxLength)
9596
{
9697
return programName;
9798
}
9899
programName = $"{benchmarkAssemblyName}-{id}";
99-
if (programName.Length <= 36)
100+
if (programName.Length <= MaxLength)
100101
{
101102
return programName;
102103
}
103104
programName = $"{folderInfo}-{id}";
104-
if (programName.Length <= 36)
105+
if (programName.Length <= MaxLength)
105106
{
106107
return programName;
107108
}
@@ -123,4 +124,4 @@ internal bool ForcedNoDependenciesForIntegrationTests
123124
}
124125
}
125126
}
126-
}
127+
}

0 commit comments

Comments
 (0)