Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19a6aa62 authored by Daniel Zheng's avatar Daniel Zheng
Browse files

Concatenate conditional

Move two separate conditional checks to one in writer_v2

Test: m libsnapshot
Change-Id: Id70db313754b770e3fa091e9c127839b9f2a5138
parent b3092928
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -636,10 +636,8 @@ bool CowWriterV2::FlushCluster() {
}

bool CowWriterV2::WriteOperation(const CowOperation& op, const void* data, size_t size) {
    if (!EnsureSpaceAvailable(next_op_pos_ + sizeof(op))) {
        return false;
    }
    if (!EnsureSpaceAvailable(next_data_pos_ + size)) {
    if (!EnsureSpaceAvailable(next_op_pos_ + sizeof(op)) ||
        !EnsureSpaceAvailable(next_data_pos_ + size)) {
        return false;
    }