From c6c4eef4e49bb4de90845408af9f642a1a4e224b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 17 Aug 2012 16:34:36 +0300 Subject: Improve size calculations. --- src/gui/updaterwindow.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/gui/updaterwindow.cpp') diff --git a/src/gui/updaterwindow.cpp b/src/gui/updaterwindow.cpp index eef8ca306..71aec58a0 100644 --- a/src/gui/updaterwindow.cpp +++ b/src/gui/updaterwindow.cpp @@ -527,7 +527,8 @@ void UpdaterWindow::loadUpdates() } std::string fixPath = mUpdatesDir + "/fix"; - for (mUpdateIndex = 0; mUpdateIndex < mUpdateFiles.size(); mUpdateIndex++) + const unsigned sz = mUpdateFiles.size(); + for (mUpdateIndex = 0; mUpdateIndex < sz; mUpdateIndex++) { UpdaterWindow::addUpdateFile(resman, mUpdatesDir, fixPath, mUpdateFiles[mUpdateIndex].name, false); @@ -551,8 +552,8 @@ void UpdaterWindow::loadLocalUpdates(std::string dir) } std::string fixPath = dir + "/fix"; - for (unsigned int updateIndex = 0; - updateIndex < updateFiles.size(); updateIndex++) + for (unsigned int updateIndex = 0, sz = updateFiles.size(); + updateIndex < sz; updateIndex ++) { UpdaterWindow::addUpdateFile(resman, dir, fixPath, updateFiles[updateIndex].name, false); @@ -567,8 +568,8 @@ void UpdaterWindow::loadManaPlusUpdates(std::string dir, std::vector updateFiles = loadXMLFile(fixPath + "/" + xmlUpdateFile); - for (unsigned int updateIndex = 0; - updateIndex < updateFiles.size(); updateIndex ++) + for (unsigned int updateIndex = 0, sz = updateFiles.size(); + updateIndex < sz; updateIndex ++) { std::string name = updateFiles[updateIndex].name; if (strStartWith(name, "manaplus_")) -- cgit v1.2.3-70-g09d2