diff --git a/src/query/frontend/logical/operator.hpp b/src/query/frontend/logical/operator.hpp index dd18dbf36..b0e8f99c0 100644 --- a/src/query/frontend/logical/operator.hpp +++ b/src/query/frontend/logical/operator.hpp @@ -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 { diff --git a/src/query/frontend/logical/planner.hpp b/src/query/frontend/logical/planner.hpp index 479c21ed3..6e049dda2 100644 --- a/src/query/frontend/logical/planner.hpp +++ b/src/query/frontend/logical/planner.hpp @@ -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)