Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy string_view passed to ETW exporter in PropertyVariant #1425

Merged
merged 4 commits into from
Jun 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/include/opentelemetry/trace/span_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class SpanContext final

bool IsRemote() const noexcept { return is_remote_; }

static SpanContext GetInvalid() { return SpanContext(false, false); }
static SpanContext GetInvalid() noexcept { return SpanContext(false, false); }

bool IsSampled() const noexcept { return trace_flags_.IsSampled(); }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class PropertyValue : public PropertyVariant
{}

/**
* @brief Convert owning PropertyValue to non-owning common::AttributeValue
* @brief Convert non-owning common::AttributeValue to owning PropertyValue.
* @return
*/
PropertyValue &FromAttributeValue(const common::AttributeValue &v)
Expand Down Expand Up @@ -222,7 +222,8 @@ class PropertyValue : public PropertyVariant
break;
}
case common::AttributeType::kTypeString: {
PropertyVariant::operator=(nostd::string_view(nostd::get<nostd::string_view>(v)).data());
PropertyVariant::operator=
(std::string{nostd::string_view(nostd::get<nostd::string_view>(v)).data()});
ThomsonTan marked this conversation as resolved.
Show resolved Hide resolved
break;
}

Expand Down