Skip to content

Conversation

@marcosbento
Copy link
Contributor

Description

When implementing the copy assignment operator, it is easy to forget the case of self-assignment.
A simple check for self-assignment can: avoid unnecessary copies, ensure correct management of resources, ensure proper exception handling.

These changes address the clang-tidy diagnostic: bugprone-unhandled-self-assignment.

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 33.33333% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.83%. Comparing base (3c93fde) to head (655af26).

Files with missing lines Patch % Lines
src/eckit/cmd/Arg.cc 0.00% 1 Missing ⚠️
src/eckit/container/KDMapped.cc 0.00% 1 Missing ⚠️
src/eckit/io/EasyCURL.cc 0.00% 1 Missing ⚠️
src/eckit/message/Message.cc 0.00% 1 Missing ⚠️
src/eckit/mpi/Group.cc 0.00% 1 Missing ⚠️
src/eckit/mpi/Status.cc 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #242      +/-   ##
===========================================
+ Coverage    65.81%   65.83%   +0.01%     
===========================================
  Files         1133     1133              
  Lines        57494    57500       +6     
  Branches      4340     4349       +9     
===========================================
+ Hits         37842    37857      +15     
+ Misses       19652    19643       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@simondsmart simondsmart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trivially correct.

@simondsmart simondsmart merged commit e23eab8 into develop Dec 16, 2025
136 of 150 checks passed
@simondsmart simondsmart deleted the feature/ensure_safe_self_assignment branch December 16, 2025 13:19
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.

4 participants