File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
src/BenchmarkDotNet/Exporters/Csv Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -6,26 +6,24 @@ namespace BenchmarkDotNet.Exporters.Csv
66{
77 public class CsvExporter : ExporterBase
88 {
9- private readonly SummaryStyle style ;
109 private readonly CsvSeparator separator ;
10+ private readonly SummaryStyle ? style ;
1111 protected override string FileExtension => "csv" ;
1212
13- public static readonly IExporter Default = new CsvExporter ( CsvSeparator . CurrentCulture , SummaryStyle . Default . WithZeroMetricValuesInContent ( ) ) ;
13+ public static readonly IExporter Default = new CsvExporter ( CsvSeparator . CurrentCulture ) ;
1414
15- public CsvExporter ( CsvSeparator separator ) : this ( separator , SummaryStyle . Default . WithZeroMetricValuesInContent ( ) )
15+ [ PublicAPI ]
16+ public CsvExporter ( CsvSeparator separator , SummaryStyle ? style = null )
1617 {
17- }
18-
19- [ PublicAPI ] public CsvExporter ( CsvSeparator separator , SummaryStyle style )
20- {
21- this . style = style ;
2218 this . separator = separator ;
19+ this . style = style ;
2320 }
2421
2522 public override void ExportToLog ( Summary summary , ILogger logger )
2623 {
2724 string realSeparator = separator . ToRealSeparator ( ) ;
28- foreach ( var line in summary . GetTable ( style . WithCultureInfo ( summary . GetCultureInfo ( ) ) ) . FullContentWithHeader )
25+ var exportStyle = ( style ?? summary . Style ) . WithZeroMetricValuesInContent ( ) ;
26+ foreach ( var line in summary . GetTable ( exportStyle ) . FullContentWithHeader )
2927 {
3028 for ( int i = 0 ; i < line . Length ; )
3129 {
You can’t perform that action at this time.
0 commit comments