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

sdk::resource::Resource::Merge should be const #1905

Merged
merged 1 commit into from
Jan 7, 2023
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 sdk/include/opentelemetry/sdk/resource/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Resource
* @returns the newly merged Resource.
*/

Resource Merge(const Resource &other) noexcept;
Resource Merge(const Resource &other) const noexcept;

/**
* Returns a newly created Resource with the specified attributes.
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/resource/resource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Resource::Resource(const ResourceAttributes &attributes, const std::string &sche
: attributes_(attributes), schema_url_(schema_url)
{}

Resource Resource::Merge(const Resource &other) noexcept
Resource Resource::Merge(const Resource &other) const noexcept
{
ResourceAttributes merged_resource_attributes(other.attributes_);
merged_resource_attributes.insert(attributes_.begin(), attributes_.end());
Expand Down