diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-07-01 13:13:04 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-07-01 13:13:04 +0300 |
commit | 4c8586dc8fde6428468fa148ff8c478cf93caeab (patch) | |
tree | 0187e7766d461b9a392ebda753bbbb264fc7dfa5 /src/gui | |
parent | 2213603c14b289ceb5389329f79f7af3cfc44faa (diff) | |
download | manaverse-4c8586dc8fde6428468fa148ff8c478cf93caeab.tar.gz manaverse-4c8586dc8fde6428468fa148ff8c478cf93caeab.tar.bz2 manaverse-4c8586dc8fde6428468fa148ff8c478cf93caeab.tar.xz manaverse-4c8586dc8fde6428468fa148ff8c478cf93caeab.zip |
improve size() usage in browserbox.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/widgets/browserbox.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index 233364765..ff269d384 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -495,8 +495,9 @@ int BrowserBox::calcHeight() else if (mEnableImages && row.find("~~~", 0) == 0) { std::string str = row.substr(3); - if (str.size() > 2 && str.substr(str.size() - 1) == "~") - str = str.substr(0, str.size() - 1); + const size_t sz = str.size(); + if (sz > 2 && str.substr(sz - 1) == "~") + str = str.substr(0, sz - 1); Image *const img = resman->getImage(str); if (img) { |