diff --git a/src/graph/InsertEdgeExecutor.cpp b/src/graph/InsertEdgeExecutor.cpp index cdde743ff90..415b885d737 100644 --- a/src/graph/InsertEdgeExecutor.cpp +++ b/src/graph/InsertEdgeExecutor.cpp @@ -63,29 +63,26 @@ Status InsertEdgeExecutor::prepare() { StatusOr> InsertEdgeExecutor::prepareEdges() { - auto status = Status::OK(); std::vector edges(rows_.size() * 2); // inbound and outbound auto index = 0; for (auto i = 0u; i < rows_.size(); i++) { auto *row = rows_[i]; - status = row->srcid()->prepare(); + auto status = row->srcid()->prepare(); if (!status.ok()) { - break; + return status; } auto v = row->srcid()->eval(); if (!Expression::isInt(v)) { - status = Status::Error("Vertex ID should be of type integer"); - break; + return Status::Error("Vertex ID should be of type integer"); } auto src = Expression::asInt(v); status = row->dstid()->prepare(); if (!status.ok()) { - break; + return status; } v = row->dstid()->eval(); if (!Expression::isInt(v)) { - status = Status::Error("Vertex ID should be of type integer"); - break; + return Status::Error("Vertex ID should be of type integer"); } auto dst = Expression::asInt(v); @@ -143,10 +140,6 @@ StatusOr> InsertEdgeExecutor::prepareEdges() { } } - if (!status.ok()) { - return status; - } - return edges; }