no oneliner if: a bug waiting to happen
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Wed, 8 Sep 2021 10:11:03 +0000 (12:11 +0200)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Tue, 26 Oct 2021 10:45:15 +0000 (12:45 +0200)
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>
src/libsync/owncloudpropagator.cpp

index 29dc5f23f0eac477951be90f8db9101c1943d558..f13e69fe5998ba83d473cd7f1cd0ab0075434ddf 100644 (file)
@@ -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();
 }