Skip to content

Commit c02c3d8

Browse files
Fix bugs and typos (#2168)
* Fix bugs * Fix typos in comments
1 parent 1fb1015 commit c02c3d8

File tree

11 files changed

+15
-15
lines changed

11 files changed

+15
-15
lines changed

src/BenchmarkDotNet.Diagnostics.Windows/Tracing/NativeMemoryLogParser.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ bool IsCallStackIn(StackSourceCallStackIndex index)
217217
return;
218218
}
219219

220-
// Heap is dieing, kill all objects in it.
220+
// Heap is dying, kill all objects in it.
221221
var allocs = lastHeapAllocs;
222222
if (data.HeapHandle != lastHeapHandle)
223223
{

src/BenchmarkDotNet.Diagnostics.Windows/Tracing/TraceLogParser.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public IEnumerable<Metric> CalculateMetrics(Dictionary<int, int> profileSourceId
160160

161161
private IterationData[] CreateIterationData(List<double> startStopTimeStamps)
162162
{
163-
// collection contains mixted .Start and .Stop intervals, if we sort it we know that n is Start and n + 1 is Stop
163+
// collection contains mixed .Start and .Stop intervals, if we sort it we know that n is Start and n + 1 is Stop
164164
startStopTimeStamps.Sort();
165165

166166
var iterations = new IterationData[startStopTimeStamps.Count / 2];

src/BenchmarkDotNet/Attributes/Filters/OperatingSystemsFilterAttribute.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class OperatingSystemsFilterAttribute : FilterConfigBaseAttribute
2525
// CLS-Compliant Code requires a constructor without an array in the argument list
2626
public OperatingSystemsFilterAttribute() { }
2727

28-
/// <param name="allowed">if set to true, the OSes beloning to platforms are enabled, if set to false, disabled</param>
28+
/// <param name="allowed">if set to true, the OSes belonging to platforms are enabled, if set to false, disabled</param>
2929
/// <param name="platforms">the platform(s) for which the filter should be applied</param>
3030
public OperatingSystemsFilterAttribute(bool allowed, params OS[] platforms)
3131
: base(new SimpleFilter(_ =>

src/BenchmarkDotNet/Disassemblers/Exporters/DisassemblyPrettifier.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ internal static IReadOnlyList<Element> Prettify(DisassembledMethod method, Disas
4444
referencedAddresses.Add(asm.ReferencedAddress.Value);
4545
}
4646

47-
// for every IP that is referenced, we emit a uinque label
47+
// for every IP that is referenced, we emit a unique label
4848
var addressesToLabels = new Dictionary<ulong, string>();
4949
int currentLabelIndex = 0;
5050
foreach (var instruction in asmInstructions)

src/BenchmarkDotNet/Environments/HostEnvironmentInfo.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public override IEnumerable<string> ToFormattedString()
9898

9999
if (RuntimeInformation.IsNetCore && IsDotNetCliInstalled())
100100
{
101-
// this wonderfull version number contains words like "preview" and ... 5 segments so it can not be parsed by Version.Parse. Example: "5.0.100-preview.8.20362.3"
101+
// this wonderful version number contains words like "preview" and ... 5 segments so it can not be parsed by Version.Parse. Example: "5.0.100-preview.8.20362.3"
102102
if (int.TryParse(new string(DotNetSdkVersion.Value.TrimStart().TakeWhile(char.IsDigit).ToArray()), out int major) && major >= 5)
103103
yield return $".NET SDK={DotNetSdkVersion.Value}";
104104
else

src/BenchmarkDotNet/Jobs/EnvironmentVariable.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class EnvironmentVariable : IEquatable<EnvironmentVariable>
88
public EnvironmentVariable([NotNull] string key, [NotNull] string value)
99
{
1010
Key = key ?? throw new ArgumentNullException(nameof(key));
11-
Value = value ?? throw new ArgumentNullException(nameof(Value));
11+
Value = value ?? throw new ArgumentNullException(nameof(value));
1212
}
1313

1414
[NotNull]

src/BenchmarkDotNet/Jobs/NugetReference.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public NuGetReference(string packageName, string packageVersion, Uri source = nu
1313

1414
PackageName = packageName;
1515

16-
if (!string.IsNullOrWhiteSpace(PackageVersion) && !IsValidVersion(packageVersion))
16+
if (!string.IsNullOrWhiteSpace(packageVersion) && !IsValidVersion(packageVersion))
1717
throw new InvalidOperationException($"Invalid version specified: {packageVersion}");
1818

1919
PackageVersion = packageVersion ?? string.Empty;

src/BenchmarkDotNet/Reports/BenchmarkReport.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public BenchmarkReport(
4444
BuildResult = buildResult;
4545
ExecuteResults = executeResults ?? Array.Empty<ExecuteResult>();
4646
AllMeasurements = ExecuteResults.SelectMany((results, index) => results.Measurements).ToArray();
47-
GcStats = ExecuteResults.Count > 0 ? executeResults[executeResults.Count -1].GcStats : default;
47+
GcStats = ExecuteResults.Count > 0 ? ExecuteResults[ExecuteResults.Count - 1].GcStats : default;
4848
Metrics = metrics?.ToDictionary(metric => metric.Descriptor.Id)
4949
?? (IReadOnlyDictionary<string, Metric>)ImmutableDictionary<string, Metric>.Empty;
5050
}

src/BenchmarkDotNet/Running/BenchmarkRunnerClean.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ internal static Summary[] Run(BenchmarkRunInfo[] benchmarkRunInfos)
4949

5050
compositeLogger.WriteLineInfo("// Validating benchmarks:");
5151

52-
var (supportedBenchmarks, validationErrors) = GetSupportedBenchmarks(benchmarkRunInfos, compositeLogger, resolver);
52+
var (supportedBenchmarks, validationErrors) = GetSupportedBenchmarks(benchmarkRunInfos, resolver);
5353

5454
validationErrors.AddRange(Validate(supportedBenchmarks));
5555

@@ -532,11 +532,11 @@ private static ExecuteResult RunExecute(ILogger logger, BenchmarkCase benchmarkC
532532
private static void LogTotalTime(ILogger logger, TimeSpan time, int executedBenchmarksCount, string message = "Total time")
533533
=> logger.WriteLineStatistic($"{message}: {time.ToFormattedTotalTime(DefaultCultureInfo.Instance)}, executed benchmarks: {executedBenchmarksCount}");
534534

535-
private static (BenchmarkRunInfo[], List<ValidationError>) GetSupportedBenchmarks(BenchmarkRunInfo[] benchmarkRunInfos, ILogger logger, IResolver resolver)
535+
private static (BenchmarkRunInfo[], List<ValidationError>) GetSupportedBenchmarks(BenchmarkRunInfo[] benchmarkRunInfos, IResolver resolver)
536536
{
537537
List<ValidationError> validationErrors = new ();
538538

539-
var benchmarksRunInfo = benchmarkRunInfos.Select(info => new BenchmarkRunInfo(
539+
var runInfos = benchmarkRunInfos.Select(info => new BenchmarkRunInfo(
540540
info.BenchmarksCases.Where(benchmark =>
541541
{
542542
var errors = benchmark.GetToolchain().Validate(benchmark, resolver).ToArray();
@@ -548,7 +548,7 @@ private static (BenchmarkRunInfo[], List<ValidationError>) GetSupportedBenchmark
548548
.Where(infos => infos.BenchmarksCases.Any())
549549
.ToArray();
550550

551-
return (benchmarkRunInfos, validationErrors);
551+
return (runInfos, validationErrors);
552552
}
553553

554554
private static string GetRootArtifactsFolderPath(BenchmarkRunInfo[] benchmarkRunInfos)

tests/BenchmarkDotNet.Tests/Running/BenchmarkConverterTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public void MethodDeclarationOrderIsPreserved()
215215

216216
public class BAC
217217
{
218-
// BAC is not sorted in either desceding or ascending way
218+
// BAC is not sorted in either descending or ascending way
219219
[Benchmark] public void B() { }
220220
[Benchmark] public void A() { }
221221
[Benchmark] public void C() { }

tests/BenchmarkDotNet.Tests/Running/JobRuntimePropertiesComparerTests.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ public void CustomTargetPlatformJobsAreGroupedByTargetFrameworkMoniker()
166166

167167
Assert.Equal(2, grouped.Length);
168168

169-
Assert.Single(grouped, group => group.Count() == 3); // Plain1 (3 methods) runing against "net5.0"
170-
Assert.Single(grouped, group => group.Count() == 6); // Plain2 (3 methods) and Plain3 (3 methods) runing against "net5.0-windows"
169+
Assert.Single(grouped, group => group.Count() == 3); // Plain1 (3 methods) running against "net5.0"
170+
Assert.Single(grouped, group => group.Count() == 6); // Plain2 (3 methods) and Plain3 (3 methods) running against "net5.0-windows"
171171
}
172172
}
173173
}

0 commit comments

Comments
 (0)