Skip to content

[CODE HEALTH] Fix clang-tidy performance-for-range-copy warnings#3932

Merged
marcalff merged 1 commit intoopen-telemetry:mainfrom
dbarker:fix_clang_tidy_performance_for_range_copy
Mar 13, 2026
Merged

[CODE HEALTH] Fix clang-tidy performance-for-range-copy warnings#3932
marcalff merged 1 commit intoopen-telemetry:mainfrom
dbarker:fix_clang_tidy_performance_for_range_copy

Conversation

@dbarker
Copy link
Member

@dbarker dbarker commented Mar 13, 2026

Fixes clang-tidy warnings


performance-for-range-copy (3 warnings)

File Line Message
opentelemetry-cpp/exporters/ostream/include/opentelemetry/exporters/ostream/common_utils.h 34 loop variable is copied but only used as const reference; consider making it a const reference
opentelemetry-cpp/sdk/include/opentelemetry/sdk/common/attributemap_hash.h 35 loop variable is copied but only used as const reference; consider making it a const reference
opentelemetry-cpp/sdk/include/opentelemetry/sdk/instrumentationscope/scope_configurator.h 92 loop variable is copied but only used as const reference; consider making it a const reference

Changes

  • fix performance-for-range-copy warnings

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@codecov
Copy link

codecov bot commented Mar 13, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.07%. Comparing base (c5ad161) to head (05ade5f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ude/opentelemetry/exporters/ostream/common_utils.h 50.00% 1 Missing ⚠️
...clude/opentelemetry/sdk/common/attributemap_hash.h 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3932   +/-   ##
=======================================
  Coverage   90.07%   90.07%           
=======================================
  Files         226      226           
  Lines        7226     7226           
=======================================
  Hits         6508     6508           
  Misses        718      718           
Files with missing lines Coverage Δ
...etry/sdk/instrumentationscope/scope_configurator.h 100.00% <100.00%> (ø)
...ude/opentelemetry/exporters/ostream/common_utils.h 53.13% <50.00%> (ø)
...clude/opentelemetry/sdk/common/attributemap_hash.h 81.25% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dbarker dbarker marked this pull request as ready for review March 13, 2026 17:30
@dbarker dbarker requested a review from a team as a code owner March 13, 2026 17:30
@marcalff marcalff merged commit 4281533 into open-telemetry:main Mar 13, 2026
68 checks passed
malkia added a commit to malkia/opentelemetry-cpp that referenced this pull request Mar 14, 2026
[CODE HEALTH] Fix clang-tidy performance-for-range-copy warnings (open-telemetry#3932)
@dbarker dbarker deleted the fix_clang_tidy_performance_for_range_copy branch March 15, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants