Use make_*_ptr to construct pointers

This commit is contained in:
Teon Banek 2017-03-11 23:05:38 +01:00
parent bce605851d
commit cfd2eae9d0
2 changed files with 4 additions and 4 deletions
src/query/frontend/logical

View File

@ -89,7 +89,7 @@ class ScanAll : public LogicalOperator {
public:
std::unique_ptr<Cursor> MakeCursor(GraphDbAccessor db) override {
return std::unique_ptr<Cursor>(new ScanAllCursor(*this, db));
return std::make_unique<ScanAllCursor>(*this, db);
}
private:
@ -111,7 +111,7 @@ class Produce : public LogicalOperator {
}
std::unique_ptr<Cursor> MakeCursor(GraphDbAccessor db) override {
return std::unique_ptr<Cursor>(new ProduceCursor(*this, db));
return std::make_unique<ProduceCursor>(*this, db);
}
std::vector<Symbol> OutputSymbols(SymbolTable& symbol_table) override {

View File

@ -22,7 +22,7 @@ std::shared_ptr<LogicalOperator> GenMatch(
throw std::runtime_error("Not implemented");
}
auto& node_part = pattern->node_parts_[0];
return std::shared_ptr<LogicalOperator>(new ScanAll(node_part));
return std::make_shared<ScanAll>(node_part);
}
std::shared_ptr<LogicalOperator> GenReturn(
@ -31,7 +31,7 @@ std::shared_ptr<LogicalOperator> GenReturn(
if (!current_op) {
throw std::runtime_error("Not implemented");
}
return std::shared_ptr<LogicalOperator>(new Produce(current_op, ret.exprs_));
return std::make_shared<Produce>(current_op, ret.exprs_);
}
std::shared_ptr<LogicalOperator> Apply(Query& query)