Skip to content

Commit 3c3ceac

Browse files
committed
Window_Command - use StringView
1 parent bf2569b commit 3c3ceac

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/window_command.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ void Window_Command::EnableItem(int i) {
6565
DrawItem(i, Font::ColorDefault);
6666
}
6767

68-
void Window_Command::SetItemText(unsigned index, std::string const& text) {
68+
void Window_Command::SetItemText(unsigned index, StringView text) {
6969
if (index < commands.size()) {
70-
commands[index] = text;
70+
commands[index] = ToString(text);
7171
DrawItem(index, Font::ColorDefault);
7272
}
7373
}

src/window_command.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class Window_Command: public Window_Selectable {
6565
* @param index command index.
6666
* @param text new item text.
6767
*/
68-
void SetItemText(unsigned index, std::string const& text);
68+
void SetItemText(unsigned index, StringView text);
6969

7070
protected:
7171
std::vector<std::string> commands;

0 commit comments

Comments
 (0)