diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-12-25 03:08:37 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-12-25 03:08:37 +0300 |
commit | 39029943851dfc318fabb95357e00b81d2735547 (patch) | |
tree | dfd195791587c51e6dca166dda8a016a1760d3bf /src/utils/translation | |
parent | 10f59701112130cf953a2af7ef4ae82d9d823fe6 (diff) | |
download | manaverse-39029943851dfc318fabb95357e00b81d2735547.tar.gz manaverse-39029943851dfc318fabb95357e00b81d2735547.tar.bz2 manaverse-39029943851dfc318fabb95357e00b81d2735547.tar.xz manaverse-39029943851dfc318fabb95357e00b81d2735547.zip |
Improve empty strings manipulation.
Diffstat (limited to 'src/utils/translation')
-rw-r--r-- | src/utils/translation/poparser.cpp | 16 | ||||
-rw-r--r-- | src/utils/translation/translationmanager.cpp | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/utils/translation/poparser.cpp b/src/utils/translation/poparser.cpp index b7c9a55ec..3a415b27b 100644 --- a/src/utils/translation/poparser.cpp +++ b/src/utils/translation/poparser.cpp @@ -64,8 +64,8 @@ PoDict *PoParser::load(const std::string &lang, const std::string &fileName, else openFile(fileName); - mMsgId = ""; - mMsgStr = ""; + mMsgId.clear(); + mMsgStr.clear(); // cycle by msgid+msgstr while (readLine()) @@ -98,8 +98,8 @@ PoDict *PoParser::load(const std::string &lang, const std::string &fileName, mDict->set(mMsgId, mMsgStr); } - mMsgId = ""; - mMsgStr = ""; + mMsgId.clear(); + mMsgStr.clear(); } return mDict; @@ -135,7 +135,7 @@ bool PoParser::readMsgId() { // reading text from: "text" mMsgId += mLine.substr(1, mLine.size() - 2); - mLine = ""; + mLine.clear(); return true; } // stop reading in other case @@ -151,7 +151,7 @@ bool PoParser::readMsgId() // reading text from: msgid "text" mMsgId += mLine.substr(msgId1.size(), mLine.size() - 1 - msgId1.size()); - mLine = ""; + mLine.clear(); return true; } // stop reading if we don't read msgid before @@ -176,7 +176,7 @@ bool PoParser::readMsgStr() { // reading text from: "text" mMsgStr += mLine.substr(1, mLine.size() - 2); - mLine = ""; + mLine.clear(); return true; } // stop reading in other case @@ -191,7 +191,7 @@ bool PoParser::readMsgStr() // reading text from: msgid "text" mMsgStr += mLine.substr(msgStr1.size(), mLine.size() - 1 - msgStr1.size()); - mLine = ""; + mLine.clear(); return true; } } diff --git a/src/utils/translation/translationmanager.cpp b/src/utils/translation/translationmanager.cpp index fe5d0951a..4d5767c8a 100644 --- a/src/utils/translation/translationmanager.cpp +++ b/src/utils/translation/translationmanager.cpp @@ -60,7 +60,7 @@ PoDict *TranslationManager::loadLang(LangVect lang, const std::string &subName, PoDict *const dict) { - std::string name = ""; + std::string name; PoParser parser; for (LangIter it = lang.begin(), it_end = lang.end(); it != it_end; ++ it) |