Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dutor committed Jul 1, 2019
1 parent f0cc159 commit bc7ec5d
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/graph/InsertEdgeExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,29 +63,26 @@ Status InsertEdgeExecutor::prepare() {


StatusOr<std::vector<storage::cpp2::Edge>> InsertEdgeExecutor::prepareEdges() {
auto status = Status::OK();
std::vector<storage::cpp2::Edge> 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);

Expand Down Expand Up @@ -143,10 +140,6 @@ StatusOr<std::vector<storage::cpp2::Edge>> InsertEdgeExecutor::prepareEdges() {
}
}

if (!status.ok()) {
return status;
}

return edges;
}

Expand Down

0 comments on commit bc7ec5d

Please sign in to comment.