From 32145342c8ba4ce25a7a321d7c62199d34d11770 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Fri, 7 Jul 2023 19:11:59 +0800 Subject: [PATCH] Unify else and if in SyncEngine::slotItemDiscovered for filesystem setmodtime check Signed-off-by: Claudio Cambra --- src/libsync/syncengine.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp index 52985fd445..313f0597e8 100644 --- a/src/libsync/syncengine.cpp +++ b/src/libsync/syncengine.cpp @@ -394,13 +394,11 @@ void OCC::SyncEngine::slotItemDiscovered(const OCC::SyncFileItemPtr &item) emit itemCompleted(item, ErrorCategory::GenericError); return; } - } else { - if (!FileSystem::setModTime(filePath, item->_modtime)) { - item->_instruction = CSYNC_INSTRUCTION_ERROR; - item->_errorString = tr("Could not update file metadata: %1").arg(filePath); - emit itemCompleted(item, ErrorCategory::GenericError); - return; - } + } else if (!FileSystem::setModTime(filePath, item->_modtime)) { + item->_instruction = CSYNC_INSTRUCTION_ERROR; + item->_errorString = tr("Could not update file metadata: %1").arg(filePath); + emit itemCompleted(item, ErrorCategory::GenericError); + return; } // Updating the db happens on success