Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make get_name() return a const reference #1952

Merged

Conversation

TakashiSato
Copy link
Contributor

This PR provides a simple update: get_name() now returns const std::string& instead of std::string. This avoids unnecessary copies and improves efficiency.

saikishor
saikishor previously approved these changes Dec 17, 2024
Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

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

Definitely

Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

Thanks, but does it make sense to change deprecated methods?

Copy link

codecov bot commented Dec 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.74%. Comparing base (7374c43) to head (57bde07).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1952   +/-   ##
=======================================
  Coverage   87.73%   87.74%           
=======================================
  Files         122      122           
  Lines       13010    13010           
  Branches     1165     1165           
=======================================
+ Hits        11414    11415    +1     
  Misses       1165     1165           
+ Partials      431      430    -1     
Flag Coverage Δ
unittests 87.74% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...de/hardware_interface/loaned_command_interface.hpp 51.35% <100.00%> (ø)
...lude/hardware_interface/loaned_state_interface.hpp 57.57% <100.00%> (ø)

... and 2 files with indirect coverage changes

@TakashiSato
Copy link
Contributor Author

@christophfroehlich
Thanks for your feedback!
I've reverted the changes to the deprecated methods.

@christophfroehlich christophfroehlich merged commit e7d2fcc into ros-controls:master Dec 18, 2024
22 of 25 checks passed
@TakashiSato TakashiSato deleted the feature/change_to_ref branch December 18, 2024 12:47
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.

3 participants