瀏覽代碼

no oneliner if: a bug waiting to happen

it is much too easy to get a bug because one could miss the lask of {
and }

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Matthieu Gallien 4 年之前
父節點
當前提交
b0ef5e0635
共有 1 個文件被更改,包括 6 次插入3 次删除
  1. 6 3
      src/libsync/owncloudpropagator.cpp

+ 6 - 3
src/libsync/owncloudpropagator.cpp

@@ -1106,15 +1106,18 @@ qint64 PropagateRootDirectory::committedDiskSpace() const
 
 bool PropagateRootDirectory::scheduleSelfOrChild()
 {
-    if (_state == Finished)
+    if (_state == Finished) {
         return false;
+    }
 
-    if (PropagateDirectory::scheduleSelfOrChild())
+    if (PropagateDirectory::scheduleSelfOrChild()) {
         return true;
+    }
 
     // Important: Finish _subJobs before scheduling any deletes.
-    if (_subJobs._state != Finished)
+    if (_subJobs._state != Finished) {
         return false;
+    }
 
     return _dirDeletionJobs.scheduleSelfOrChild();
 }