From 39029943851dfc318fabb95357e00b81d2735547 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 25 Dec 2012 03:08:37 +0300 Subject: Improve empty strings manipulation. --- src/client.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/client.cpp') diff --git a/src/client.cpp b/src/client.cpp index 2ec9c183c..7248aae43 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -1029,7 +1029,7 @@ int Client::gameExec() if (loginData.remember) loginData.username = serverConfig.getValue("username", ""); else - loginData.username = ""; + loginData.username.clear(); } else { @@ -1543,7 +1543,7 @@ int Client::gameExec() mCurrentDialog->addActionListener(&accountListener); mCurrentDialog = nullptr; // OkDialog deletes itself loginData.password = loginData.newPassword; - loginData.newPassword = ""; + loginData.newPassword.clear(); BLOCK_END("Client::gameExec STATE_CHANGEPASSWORD_SUCCESS") break; @@ -1716,7 +1716,7 @@ void Client::action(const gcn::ActionEvent &event) return; } if (eventId == "Setup") - tab = ""; + tab.clear(); else if (eventId == "Video") tab = "Video"; else if (eventId == "Themes") @@ -1965,7 +1965,7 @@ void Client::initConfiguration() const config.setValue("fpslimit", 60); std::string defaultUpdateHost = branding.getValue("defaultUpdateHost", ""); if (!checkPath(defaultUpdateHost)) - defaultUpdateHost = ""; + defaultUpdateHost.clear(); config.setValue("updatehost", defaultUpdateHost); config.setValue("customcursor", true); config.setValue("useScreenshotDirectorySuffix", true); @@ -2163,7 +2163,7 @@ void Client::accountLogin(LoginData *const data) const Net::getLoginHandler()->loginAccount(data); // Clear the password, avoids auto login when returning to login - data->password = ""; + data->password.clear(); // TODO This is not the best place to save the config, but at least better // than the login gui window -- cgit v1.2.3-70-g09d2