Skip to content

Commit 4125d9f

Browse files
committed
Cleanup
1 parent 0c1d3a3 commit 4125d9f

File tree

7 files changed

+8
-10
lines changed

7 files changed

+8
-10
lines changed

examples/yaml/custom_sampler_builder.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ std::unique_ptr<opentelemetry::sdk::trace::Sampler> CustomSamplerBuilder::Build(
1515
// Read yaml attributes
1616
std::string comment = model->node->GetRequiredString("comment");
1717

18-
std::unique_ptr<opentelemetry::sdk::trace::Sampler> sdk(new CustomSampler(comment));
18+
auto sdk = std::make_unique<CustomSampler>(comment);
1919

2020
return sdk;
2121
}

examples/yaml/custom_span_exporter.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
std::unique_ptr<opentelemetry::sdk::trace::Recordable> CustomSpanExporter::MakeRecordable() noexcept
1111
{
12-
return std::unique_ptr<opentelemetry::sdk::trace::Recordable>(
13-
new opentelemetry::sdk::trace::SpanData);
12+
auto recordable = std::make_unique<opentelemetry::sdk::trace::SpanData>();
13+
return recordable;
1414
}
1515

1616
opentelemetry::sdk::common::ExportResult CustomSpanExporter::Export(

examples/yaml/custom_span_exporter_builder.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ std::unique_ptr<opentelemetry::sdk::trace::SpanExporter> CustomSpanExporterBuild
1717
// Read yaml attributes
1818
std::string comment = model->node->GetRequiredString("comment");
1919

20-
std::unique_ptr<opentelemetry::sdk::trace::SpanExporter> sdk(new CustomSpanExporter(comment));
20+
auto sdk = std::make_unique<CustomSpanExporter>(comment);
2121

2222
return sdk;
2323
}

examples/yaml/custom_span_processor.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
std::unique_ptr<opentelemetry::sdk::trace::Recordable>
1414
CustomSpanProcessor::MakeRecordable() noexcept
1515
{
16-
return std::unique_ptr<opentelemetry::sdk::trace::Recordable>(
17-
new opentelemetry::sdk::trace::SpanData);
16+
auto recordable = std::make_unique<opentelemetry::sdk::trace::SpanData>();
17+
return recordable;
1818
}
1919

2020
void CustomSpanProcessor::OnStart(

examples/yaml/custom_span_processor_builder.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ std::unique_ptr<opentelemetry::sdk::trace::SpanProcessor> CustomSpanProcessorBui
1717
// Read yaml attributes
1818
std::string comment = model->node->GetRequiredString("comment");
1919

20-
std::unique_ptr<opentelemetry::sdk::trace::SpanProcessor> sdk(new CustomSpanProcessor(comment));
20+
auto sdk = std::make_unique<CustomSpanProcessor>(comment);
2121

2222
return sdk;
2323
}

sdk/src/configuration/document_node.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33

44
#include <cctype>
55
#include <cstdlib>
6-
#include <ostream>
76
#include <string>
87

98
#include "opentelemetry/sdk/common/env_variables.h"
10-
#include "opentelemetry/sdk/common/global_log_handler.h"
119
#include "opentelemetry/sdk/configuration/document_node.h"
1210
#include "opentelemetry/sdk/configuration/invalid_schema_exception.h"
1311
#include "opentelemetry/version.h"

sdk/src/init/sdk_builder.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,7 @@ void SdkBuilder::SetResource(
15901590
std::unique_ptr<ConfiguredSdk> SdkBuilder::CreateConfiguredSdk(
15911591
const std::unique_ptr<opentelemetry::sdk::configuration::Configuration> &model) const
15921592
{
1593-
std::unique_ptr<ConfiguredSdk> sdk(new ConfiguredSdk);
1593+
auto sdk = std::make_unique<ConfiguredSdk>();
15941594

15951595
if (!model->disabled)
15961596
{

0 commit comments

Comments
 (0)