@@ -314,10 +314,10 @@ class Project : public Node {
314
314
public:
315
315
// Takes memory ownership of the expressions.
316
316
Project (ExprPtrVector exprs,
317
- const std::vector<std::string>& fields,
317
+ std::vector<std::string> fields,
318
318
std::shared_ptr<const Node> input)
319
319
: exprs_(std::move(exprs))
320
- , fields_(fields)
320
+ , fields_(std::move( fields) )
321
321
, hint_applied_(false )
322
322
, hints_(std::make_unique<Hints>()) {
323
323
inputs_.push_back (input);
@@ -353,7 +353,7 @@ class Project : public Node {
353
353
const ExprPtrVector& getExprs () const { return exprs_; }
354
354
355
355
const std::vector<std::string>& getFields () const { return fields_; }
356
- void setFields (std::vector<std::string>&& fields) { fields_ = std::move (fields); }
356
+ void setFields (std::vector<std::string> fields) { fields_ = std::move (fields); }
357
357
358
358
const std::string getFieldName (const size_t i) const {
359
359
CHECK_LT (i, fields_.size ());
@@ -434,14 +434,14 @@ class Aggregate : public Node {
434
434
// Takes ownership of the aggregate expressions.
435
435
Aggregate (const size_t groupby_count,
436
436
ExprPtrVector aggs,
437
- const std::vector<std::string>& fields,
437
+ std::vector<std::string> fields,
438
438
std::shared_ptr<const Node> input)
439
439
: groupby_count_(groupby_count)
440
- , aggs_(aggs)
441
- , fields_(fields)
440
+ , aggs_(std::move( aggs) )
441
+ , fields_(std::move( fields) )
442
442
, hint_applied_(false )
443
443
, hints_(std::make_unique<Hints>()) {
444
- inputs_.push_back ( input);
444
+ inputs_.emplace_back ( std::move ( input) );
445
445
}
446
446
447
447
Aggregate (Aggregate const &);
@@ -453,9 +453,7 @@ class Aggregate : public Node {
453
453
const size_t getAggsCount () const { return aggs_.size (); }
454
454
455
455
const std::vector<std::string>& getFields () const { return fields_; }
456
- void setFields (std::vector<std::string>&& new_fields) {
457
- fields_ = std::move (new_fields);
458
- }
456
+ void setFields (std::vector<std::string> new_fields) { fields_ = std::move (new_fields); }
459
457
460
458
const std::string getFieldName (const size_t i) const {
461
459
CHECK_LT (i, fields_.size ());
@@ -550,8 +548,8 @@ class Join : public Node {
550
548
, join_type_(join_type)
551
549
, hint_applied_(false )
552
550
, hints_(std::make_unique<Hints>()) {
553
- inputs_.push_back ( lhs);
554
- inputs_.push_back ( rhs);
551
+ inputs_.emplace_back ( std::move ( lhs) );
552
+ inputs_.emplace_back ( std::move ( rhs) );
555
553
}
556
554
557
555
Join (Join const &);
@@ -744,7 +742,7 @@ class Filter : public Node {
744
742
Filter(ExprPtr condition, std::shared_ptr<const Node> input)
745
743
: condition_(std::move(condition)) {
746
744
CHECK(condition_);
747
- inputs_.push_back( input);
745
+ inputs_.emplace_back(std::move( input) );
748
746
}
749
747
750
748
// for dummy filter node for data recycler
@@ -939,12 +937,15 @@ class Compound : public Node {
939
937
940
938
class Sort : public Node {
941
939
public:
942
- Sort(const std::vector<SortField>& collation,
940
+ Sort(std::vector<SortField> collation,
943
941
const size_t limit,
944
942
const size_t offset,
945
943
std::shared_ptr<const Node> input)
946
- : collation_(collation), limit_(limit), offset_(offset), empty_result_(false) {
947
- inputs_.push_back(input);
944
+ : collation_(std::move(collation))
945
+ , limit_(limit)
946
+ , offset_(offset)
947
+ , empty_result_(false) {
948
+ inputs_.emplace_back(std::move(input));
948
949
}
949
950
950
951
bool operator==(const Sort& that) const {
@@ -959,7 +960,7 @@ class Sort : public Node {
959
960
return collation_[i];
960
961
}
961
962
962
- void setCollation(std::vector<SortField>&& collation) {
963
+ void setCollation(std::vector<SortField> collation) {
963
964
collation_ = std::move(collation);
964
965
}
965
966
@@ -1033,8 +1034,8 @@ class TableFunction : public Node {
1033
1034
: Node(std::move(inputs))
1034
1035
, function_name_(function_name)
1035
1036
, fields_(std::move(fields))
1036
- , col_input_exprs_(col_input_exprs)
1037
- , table_func_input_exprs_(table_func_input_exprs)
1037
+ , col_input_exprs_(std::move( col_input_exprs) )
1038
+ , table_func_input_exprs_(std::move( table_func_input_exprs) )
1038
1039
, tuple_type_(std::move(tuple_type)) {}
1039
1040
1040
1041
TableFunction(TableFunction const&);
@@ -1118,9 +1119,9 @@ class TableFunction : public Node {
1118
1119
1119
1120
class LogicalValues : public Node {
1120
1121
public:
1121
- LogicalValues(const std::vector<TargetMetaInfo>& tuple_type,
1122
+ LogicalValues(std::vector<TargetMetaInfo> tuple_type,
1122
1123
std::vector<ExprPtrVector> values)
1123
- : tuple_type_(tuple_type), values_(std::move(values)) {}
1124
+ : tuple_type_(std::move( tuple_type) ), values_(std::move(values)) {}
1124
1125
1125
1126
LogicalValues(LogicalValues const&);
1126
1127
0 commit comments