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
6
6
{
7
7
public class CsvExporter : ExporterBase
8
8
{
9
- private readonly SummaryStyle style ;
10
9
private readonly CsvSeparator separator ;
10
+ private readonly SummaryStyle ? style ;
11
11
protected override string FileExtension => "csv" ;
12
12
13
- public static readonly IExporter Default = new CsvExporter ( CsvSeparator . CurrentCulture , SummaryStyle . Default . WithZeroMetricValuesInContent ( ) ) ;
13
+ public static readonly IExporter Default = new CsvExporter ( CsvSeparator . CurrentCulture ) ;
14
14
15
- public CsvExporter ( CsvSeparator separator ) : this ( separator , SummaryStyle . Default . WithZeroMetricValuesInContent ( ) )
15
+ [ PublicAPI ]
16
+ public CsvExporter ( CsvSeparator separator , SummaryStyle ? style = null )
16
17
{
17
- }
18
-
19
- [ PublicAPI ] public CsvExporter ( CsvSeparator separator , SummaryStyle style )
20
- {
21
- this . style = style ;
22
18
this . separator = separator ;
19
+ this . style = style ;
23
20
}
24
21
25
22
public override void ExportToLog ( Summary summary , ILogger logger )
26
23
{
27
24
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 )
29
27
{
30
28
for ( int i = 0 ; i < line . Length ; )
31
29
{
You can’t perform that action at this time.
0 commit comments