Skip to content

Commit

Permalink
Refactor get_name methods to return const references for improved per…
Browse files Browse the repository at this point in the history
…formance
TakashiSato committed Dec 17, 2024
1 parent 10caa58 commit e2e56a8
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -81,12 +81,12 @@ class LoanedCommandInterface
}
}

const std::string get_name() const { return command_interface_.get_name(); }
const std::string & get_name() const { return command_interface_.get_name(); }

const std::string & get_interface_name() const { return command_interface_.get_interface_name(); }

[[deprecated(
"Replaced by get_name method, which is semantically more correct")]] const std::string
"Replaced by get_name method, which is semantically more correct")]] const std::string &
get_full_name() const
{
return command_interface_.get_name();
Original file line number Diff line number Diff line change
@@ -75,12 +75,12 @@ class LoanedStateInterface
}
}

const std::string get_name() const { return state_interface_.get_name(); }
const std::string & get_name() const { return state_interface_.get_name(); }

const std::string & get_interface_name() const { return state_interface_.get_interface_name(); }

[[deprecated(
"Replaced by get_name method, which is semantically more correct")]] const std::string
"Replaced by get_name method, which is semantically more correct")]] const std::string &
get_full_name() const
{
return state_interface_.get_name();

0 comments on commit e2e56a8

Please sign in to comment.