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>
This commit is contained in:
Matthieu Gallien 2021-09-08 12:11:03 +02:00
parent 51a77bac28
commit b0ef5e0635

View 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();
}