Skip to content

Commit 37af055

Browse files
committed
chore: enable nullable for StatisticColumn.cs
1 parent d53bb8d commit 37af055

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/BenchmarkDotNet/Columns/StatisticColumn.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
using Perfolizer.Metrology;
1313
using Pragmastat.Metrology;
1414

15+
#nullable enable
16+
1517
namespace BenchmarkDotNet.Columns
1618
{
1719
public interface IStatisticColumn : IColumn
@@ -105,7 +107,7 @@ private enum Priority
105107
public string Id => nameof(StatisticColumn) + "." + ColumnName;
106108
public string ColumnName { get; }
107109
private readonly Priority priority;
108-
private readonly IStatisticColumn parentColumn;
110+
private readonly IStatisticColumn? parentColumn;
109111

110112
private StatisticColumn(string columnName, string legend, Func<Statistics, double> calc, Priority priority, UnitType type = UnitType.Time,
111113
IStatisticColumn? parentColumn = null)
@@ -137,7 +139,7 @@ public List<double> GetAllValues(Summary summary, SummaryStyle style)
137139
{
138140
return summary.Reports
139141
.Where(r => r.ResultStatistics != null)
140-
.Select(r => calc(r.ResultStatistics))
142+
.Select(r => calc(r.ResultStatistics!))
141143
.Where(v => !double.IsNaN(v) && !double.IsInfinity(v))
142144
.Select(v => UnitType == UnitType.Time && style.TimeUnit != null ? v / style.TimeUnit.BaseUnits : v)
143145
.ToList();

0 commit comments

Comments
 (0)