From 362557935b0dd6b7941ae667cefae79481218e07 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 14 Feb 2016 14:04:36 +0100 Subject: WAGE: Use String::clear() for emptying stings --- engines/wage/gui-console.cpp | 4 ++-- engines/wage/menu.cpp | 2 +- engines/wage/wage.cpp | 5 ++--- engines/wage/world.cpp | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/engines/wage/gui-console.cpp b/engines/wage/gui-console.cpp index 92e61f9617..2f4bac2937 100644 --- a/engines/wage/gui-console.cpp +++ b/engines/wage/gui-console.cpp @@ -87,13 +87,13 @@ void Gui::appendText(const char *s) { // Okay, we got new lines, need to split it // and push substrings individually - Common::String tmp = ""; + Common::String tmp; for (uint i = 0; i < str.size(); i++) { if (str[i] == '\n') { _out.push_back(tmp); flowText(tmp); - tmp = ""; + tmp.clear(); continue; } diff --git a/engines/wage/menu.cpp b/engines/wage/menu.cpp index e6d4655012..d6dbcfbd4a 100644 --- a/engines/wage/menu.cpp +++ b/engines/wage/menu.cpp @@ -249,7 +249,7 @@ void Menu::createCommandsMenu(MenuItem *menu) { menu->subitems.push_back(new MenuSubItem(item.c_str(), kMenuActionCommand, style, shortcut, enabled)); } - item = ""; + item.clear(); } } diff --git a/engines/wage/wage.cpp b/engines/wage/wage.cpp index 92602234dd..f36d7ce239 100644 --- a/engines/wage/wage.cpp +++ b/engines/wage/wage.cpp @@ -171,7 +171,7 @@ void WageEngine::processEvents() { break; processTurn(&_inputText, NULL); - _inputText = ""; + _inputText.clear(); _gui->appendText(""); _gui->disableUndo(); break; @@ -212,8 +212,7 @@ void WageEngine::setMenu(Common::String menu) { void WageEngine::appendText(const char *str) { _gui->appendText(str); - if (_inputText.size()) - _inputText = ""; + _inputText.clear(); } void WageEngine::gameOver() { diff --git a/engines/wage/world.cpp b/engines/wage/world.cpp index 19af33cbf6..79dc456e6e 100644 --- a/engines/wage/world.cpp +++ b/engines/wage/world.cpp @@ -265,7 +265,7 @@ bool World::loadWorld(Common::MacResManager *resMan) { res = resMan->getResource(MKTAG('M','E','N','U'), 2001); if (res != NULL) { Common::StringArray *menu = readMenu(res); - _aboutMenuItemName = ""; + _aboutMenuItemName.clear(); Common::String string = menu->operator[](1); for (int i = 0; i < string.size() && string[i] != ';'; i++) // Read token -- cgit v1.2.3