Skip to content

Commit

Permalink
2x change from return by copy to return by reference on const strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
fendrin committed Jun 7, 2014
1 parent a25ff8d commit 8750dec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/hotkey/hotkey_command.cpp
Expand Up @@ -455,12 +455,12 @@ void delete_all_wml_hotkeys()
}
}

const std::string get_description(const std::string& command)
const std::string& get_description(const std::string& command)
{
return get_hotkey_command(command).description;
}

const std::string get_tooltip(const std::string& command)
const std::string& get_tooltip(const std::string& command)
{
// the null hotkey_command has the "" tooltip
return get_hotkey_command(command).tooltip;
Expand Down
4 changes: 2 additions & 2 deletions src/hotkey/hotkey_command.hpp
Expand Up @@ -262,8 +262,8 @@ void delete_all_wml_hotkeys();
///removes a wml hotkey with the given id, returns true if the deletion was successful
bool remove_wml_hotkey(const std::string& id);

const std::string get_description(const std::string& command);
const std::string get_tooltip(const std::string& command);
const std::string& get_description(const std::string& command);
const std::string& get_tooltip(const std::string& command);

void init_hotkey_commands();

Expand Down

0 comments on commit 8750dec

Please sign in to comment.