Skip to content

Commit af8c97b

Browse files
committed
Window_BattleMessage - StringView
1 parent 21a06b9 commit af8c97b

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/window_battlemessage.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Window_BattleMessage::Window_BattleMessage(int ix, int iy, int iwidth, int iheig
3535
SetZ(Priority_Window + 50);
3636
}
3737

38-
void Window_BattleMessage::Push(const std::string& message) {
38+
void Window_BattleMessage::Push(StringView message) {
3939
#ifdef EP_DEBUG_BATTLE2K_MESSAGE
4040
Output::Debug("Battle2k Message Push \"{}\"", message);
4141
#endif
@@ -60,7 +60,7 @@ void Window_BattleMessage::PushLine(StringView line) {
6060
needs_refresh = true;
6161
}
6262

63-
void Window_BattleMessage::PushWithSubject(const std::string& message, const std::string& subject) {
63+
void Window_BattleMessage::PushWithSubject(StringView message, StringView subject) {
6464
if (Player::IsRPG2kE()) {
6565
Push(Utils::ReplacePlaceholders(
6666
message,
@@ -69,7 +69,7 @@ void Window_BattleMessage::PushWithSubject(const std::string& message, const std
6969
));
7070
}
7171
else {
72-
Push(subject + message);
72+
Push(std::string(subject) + std::string(message));
7373
}
7474
needs_refresh = true;
7575
}

src/window_battlemessage.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Window_BattleMessage : public Window_Base {
4040
*
4141
* @param message The text to be displayed.
4242
*/
43-
void Push(const std::string& message);
43+
void Push(StringView message);
4444

4545
/**
4646
* Pushes a message, either prepending the subject to it,
@@ -50,7 +50,7 @@ class Window_BattleMessage : public Window_Base {
5050
* @param message Message to be displayed.
5151
* @param subject Subject that will be displayed in the message.
5252
*/
53-
void PushWithSubject(const std::string& message, const std::string& subject);
53+
void PushWithSubject(StringView message, StringView subject);
5454

5555
void Pop();
5656

0 commit comments

Comments
 (0)