diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-02-10 23:35:30 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-02-10 23:35:30 +0100 |
commit | 8712ce09e8f3a86dcf2f6c8ee7d030e3b41a4618 (patch) | |
tree | 3588c5990b6e5d6a0616442cb5bb4a4a76daff65 /src/gui/login.cpp | |
parent | fadc53015b35b6b51313fb1c1debea82e85b8110 (diff) | |
download | mana-8712ce09e8f3a86dcf2f6c8ee7d030e3b41a4618.tar.gz mana-8712ce09e8f3a86dcf2f6c8ee7d030e3b41a4618.tar.bz2 mana-8712ce09e8f3a86dcf2f6c8ee7d030e3b41a4618.tar.xz mana-8712ce09e8f3a86dcf2f6c8ee7d030e3b41a4618.zip |
Use string::empty() instead of comparing to ""
Diffstat (limited to 'src/gui/login.cpp')
-rw-r--r-- | src/gui/login.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/login.cpp b/src/gui/login.cpp index 47d5a99e..90ceab1a 100644 --- a/src/gui/login.cpp +++ b/src/gui/login.cpp @@ -189,7 +189,7 @@ bool LoginDialog::canSubmit() bool LoginDialog::isUShort(const std::string &str) { - if (str == "") + if (str.empty()) { return false; } @@ -228,7 +228,7 @@ unsigned short LoginDialog::getUShort(const std::string &str) void LoginDialog::DropDownList::saveEntry(const std::string &server, const std::string &port, int &saved) { - if (saved < MAX_SERVER_LIST_SIZE && server != "") + if (saved < MAX_SERVER_LIST_SIZE && !server.empty()) { config.setValue(mConfigPrefix + "Server" + toString(saved), server); config.setValue(mConfigPrefix + "Port" + toString(saved), port); @@ -247,7 +247,7 @@ LoginDialog::DropDownList::DropDownList(std::string prefix, { std::string server = config.getValue(mConfigPrefix + "Server" + toString(i), ""); - if (server == "") // Just in case had original config entries + if (server.empty()) // Just in case had original config entries { server = config.getValue(mConfigPrefix + "ServerList" + toString(i), ""); @@ -255,13 +255,13 @@ LoginDialog::DropDownList::DropDownList(std::string prefix, std::string port = config.getValue(mConfigPrefix + "Port" + toString(i), dfltPort.front()); - if (server != "") + if (!server.empty()) { mServers.push_back(server); mPorts.push_back(port); } } - if (mServers.size() == 0) + if (mServers.empty()) { mServers.assign(dflt.begin(), dflt.end()); mPorts.assign(dfltPort.begin(), dfltPort.end()); |