summaryrefslogtreecommitdiffstats
path: root/logic/updater
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-12-13 02:52:54 +0100
committerPetr Mrázek <peterix@gmail.com>2013-12-13 02:52:54 +0100
commit382e4fe6b346d27f03a69f028904186334ed2fec (patch)
treeb6c1a704e2b29465cadddd6e83e1d090e69ff5c9 /logic/updater
parent7d20e2478a2166caccd92c3af4b19d80383cce2b (diff)
downloadMultiMC-382e4fe6b346d27f03a69f028904186334ed2fec.tar
MultiMC-382e4fe6b346d27f03a69f028904186334ed2fec.tar.gz
MultiMC-382e4fe6b346d27f03a69f028904186334ed2fec.tar.lz
MultiMC-382e4fe6b346d27f03a69f028904186334ed2fec.tar.xz
MultiMC-382e4fe6b346d27f03a69f028904186334ed2fec.zip
Fix syntax error
You do not need goto for that. Really.
Diffstat (limited to 'logic/updater')
-rw-r--r--logic/updater/DownloadUpdateTask.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/logic/updater/DownloadUpdateTask.cpp b/logic/updater/DownloadUpdateTask.cpp
index 250092ed..d9aab826 100644
--- a/logic/updater/DownloadUpdateTask.cpp
+++ b/logic/updater/DownloadUpdateTask.cpp
@@ -239,21 +239,19 @@ void DownloadUpdateTask::processFileLists()
// delete anything in the current one version's list that isn't in the new version's list.
for (VersionFileEntry entry : m_cVersionFileList)
{
+ bool keep = false;
for (VersionFileEntry newEntry : m_nVersionFileList)
- {
+ {
if (newEntry.path == entry.path)
{
QLOG_DEBUG() << "Not deleting" << entry.path << "because it is still present in the new version.";
- goto SkipFile;
+ keep = true;
+ break;
}
}
- // If the loop reaches the end, we didn't find a match. Delete the file.
- m_operationList.append(UpdateOperation::DeleteOp(entry.path));
-
-SkipFile:
- // We goto here from the inner loop if we find an entry that has a corresponding entry in the new version's file list.
- // This allows us to effectively continue the outer loop from the inner loop.
- // In this case, goto is the more readable option.
+ // If the loop reaches the end and we didn't find a match, delete the file.
+ if(!keep)
+ m_operationList.append(UpdateOperation::DeleteOp(entry.path));
}
// Create a network job for downloading files.