From 4c8586dc8fde6428468fa148ff8c478cf93caeab Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 1 Jul 2013 13:13:04 +0300 Subject: improve size() usage in browserbox. --- src/gui/widgets/browserbox.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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) { -- cgit v1.2.3-70-g09d2