File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
ortools/constraint_solver Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1161,8 +1161,7 @@ ResourceGroup* RoutingModel::AddResourceGroup() {
11611161
11621162int ResourceGroup::AddResource (Attributes attributes,
11631163 const RoutingDimension* dimension) {
1164- resources_.push_back (Resource (model_));
1165- resources_.back ().SetDimensionAttributes (std::move (attributes), dimension);
1164+ resources_.push_back ({std::move (attributes), dimension});
11661165
11671166 affected_dimension_indices_.insert (dimension->index ());
11681167
Original file line number Diff line number Diff line change @@ -448,13 +448,15 @@ class OR_DLL RoutingModel {
448448 }
449449
450450 private:
451- explicit Resource (const RoutingModel* model) : model_(model) {}
451+ Resource (ResourceGroup::Attributes attributes,
452+ const RoutingDimension* dimension) {
453+ SetDimensionAttributes (std::move (attributes), dimension);
454+ }
452455
453456 void SetDimensionAttributes (ResourceGroup::Attributes attributes,
454457 const RoutingDimension* dimension);
455458 const ResourceGroup::Attributes& GetDefaultAttributes () const ;
456459
457- const RoutingModel* const model_;
458460 absl::flat_hash_map<DimensionIndex, int > dimension_attributes_;
459461 util_intops::StrongVector<DimensionIndex, int >
460462 dimension_attributes_per_index_;
You can’t perform that action at this time.
0 commit comments