Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Functions having rvalue reference arguments should "std::move" those arguments (Sonar).
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 28 Jun 2023 17:31:11 +0000 (19:31 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 28 Jun 2023 17:33:19 +0000 (19:33 +0200)
src/mc/explo/udpor/EventSet.cpp
src/mc/explo/udpor/EventSet.hpp

index 8f017f9..929234e 100644 (file)
@@ -14,7 +14,7 @@
 
 namespace simgrid::mc::udpor {
 
-EventSet::EventSet(Configuration&& config) : EventSet(config.get_events()) {}
+EventSet::EventSet(const Configuration& config) : EventSet(config.get_events()) {}
 
 void EventSet::remove(const UnfoldingEvent* e)
 {
index 9c09185..32be66f 100644 (file)
@@ -27,9 +27,12 @@ public:
   EventSet& operator=(const EventSet&) = default;
   EventSet& operator=(EventSet&&)      = default;
   EventSet(EventSet&&)                 = default;
-  explicit EventSet(Configuration&& config);
-  explicit EventSet(std::vector<const UnfoldingEvent*>&& raw_events) : events_(raw_events.begin(), raw_events.end()) {}
-  explicit EventSet(std::unordered_set<const UnfoldingEvent*>&& raw_events) : events_(raw_events) {}
+  explicit EventSet(const Configuration& config);
+  explicit EventSet(const std::vector<const UnfoldingEvent*>& raw_events)
+      : events_(raw_events.begin(), raw_events.end())
+  {
+  }
+  explicit EventSet(std::unordered_set<const UnfoldingEvent*>&& raw_events) : events_(std::move(raw_events)) {}
   explicit EventSet(std::initializer_list<const UnfoldingEvent*> event_list) : events_(std::move(event_list)) {}
 
   auto begin() const { return this->events_.begin(); }