From 201b347588973de0288f66d804b2edb9c8b6cdb9 Mon Sep 17 00:00:00 2001 From: Ehsan Saei <71217171+esigo@users.noreply.github.com> Date: Sat, 7 Jan 2023 22:46:52 +0100 Subject: [PATCH] sdk::resource::Resource::Merge should be const (#1905) --- sdk/include/opentelemetry/sdk/resource/resource.h | 2 +- sdk/src/resource/resource.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/include/opentelemetry/sdk/resource/resource.h b/sdk/include/opentelemetry/sdk/resource/resource.h index eee339e237..c69b971b04 100644 --- a/sdk/include/opentelemetry/sdk/resource/resource.h +++ b/sdk/include/opentelemetry/sdk/resource/resource.h @@ -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. diff --git a/sdk/src/resource/resource.cc b/sdk/src/resource/resource.cc index 410e7318b1..a07f4d3a3c 100644 --- a/sdk/src/resource/resource.cc +++ b/sdk/src/resource/resource.cc @@ -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());