From 6a31c49432a922c6233f082bb3e1c65bf7476b44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1nos=20Benjamin=20Antal?= Date: Tue, 25 Oct 2022 20:30:29 +0200 Subject: [PATCH] Flatten nested conditional statements --- src/query/v2/plan/operator.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/query/v2/plan/operator.cpp b/src/query/v2/plan/operator.cpp index 0415c9d7d..64362bf18 100644 --- a/src/query/v2/plan/operator.cpp +++ b/src/query/v2/plan/operator.cpp @@ -397,11 +397,10 @@ class DistributedScanAllAndFilterCursor : public Cursor { request_state_.label = label_.has_value() ? std::make_optional(shard_manager.LabelToName(*label_)) : std::nullopt; - if (current_vertex_it == current_batch.end()) { - if (request_state_.state == State::COMPLETED || !MakeRequest(shard_manager, context)) { - ResetExecutionState(); - continue; - } + if (current_vertex_it == current_batch.end() && + (request_state_.state == State::COMPLETED || !MakeRequest(shard_manager, context))) { + ResetExecutionState(); + continue; } frame[output_symbol_] = TypedValue(std::move(*current_vertex_it));