Skip to content

Commit

Permalink
Window_Command - use StringView
Browse files Browse the repository at this point in the history
  • Loading branch information
mateofio committed Aug 26, 2020
1 parent eb26775 commit 723ce46
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/window_command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ void Window_Command::EnableItem(int i) {
DrawItem(i, Font::ColorDefault);
}

void Window_Command::SetItemText(unsigned index, std::string const& text) {
void Window_Command::SetItemText(unsigned index, StringView text) {
if (index < commands.size()) {
commands[index] = text;
commands[index] = ToString(text);
DrawItem(index, Font::ColorDefault);
}
}
2 changes: 1 addition & 1 deletion src/window_command.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Window_Command: public Window_Selectable {
* @param index command index.
* @param text new item text.
*/
void SetItemText(unsigned index, std::string const& text);
void SetItemText(unsigned index, StringView text);

protected:
std::vector<std::string> commands;
Expand Down

0 comments on commit 723ce46

Please sign in to comment.