Skip to content

Commit

Permalink
sdk::resource::Resource::Merge should be const (#1905)
Browse files Browse the repository at this point in the history
  • Loading branch information
esigo authored Jan 7, 2023
1 parent d557191 commit 201b347
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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

0 comments on commit 201b347

Please sign in to comment.