diff --git a/projects/rocprofiler/src/core/context.h b/projects/rocprofiler/src/core/context.h index 88320ef32f..7131d3383b 100644 --- a/projects/rocprofiler/src/core/context.h +++ b/projects/rocprofiler/src/core/context.h @@ -257,7 +257,7 @@ class Context { void GetMetricsData() const { const MetricArgs args(info_map_); - for (const auto v : metrics_map_) { + for (const auto& v : metrics_map_) { const std::string& name = v.first; const Metric* metric = v.second; const xml::Expr* expr = metric->GetExpr(); diff --git a/projects/rocprofiler/src/core/metrics.h b/projects/rocprofiler/src/core/metrics.h index 57ec7c3199..a221168a55 100644 --- a/projects/rocprofiler/src/core/metrics.h +++ b/projects/rocprofiler/src/core/metrics.h @@ -277,7 +277,7 @@ class MetricsDict { std::cout << name << "=" << expr_obj->String() << "\n" << std::endl; #endif counters_vec_t counters_vec; - for (const std::string var : expr_obj->GetVars()) { + for (const std::string& var : expr_obj->GetVars()) { auto it = cache_.find(var); if (it == cache_.end()) { EXC_RAISING(HSA_STATUS_ERROR, "Bad metric '" << name << "', var '" << var << "' is not found");