Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[cppcheck] Pass parameters by const reference.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 6 May 2021 13:44:22 +0000 (15:44 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 10 May 2021 09:52:53 +0000 (11:52 +0200)
examples/cpp/clusters-multicpu/s4u-clusters-multicpu.cpp
include/simgrid/s4u/NetZone.hpp
src/mc/udpor_global.hpp
src/s4u/s4u_Netzone.cpp

index 0cf10c4..b0775fe 100644 (file)
@@ -20,7 +20,7 @@ class Sender {
   std::vector<sg4::Host*> hosts_;
 
 public:
-  explicit Sender(const std::vector<sg4::Host*> hosts) : hosts_{hosts} {}
+  explicit Sender(const std::vector<sg4::Host*>& hosts) : hosts_{hosts} {}
   void operator()() const
   {
     /* Vector in which we store all ongoing communications */
index 21c0606..b4dc45b 100644 (file)
@@ -141,7 +141,7 @@ public:
 
 private:
   /** @brief Auxiliary function to get list of LinkImpl */
-  static std::vector<kernel::resource::LinkImpl*> get_link_list_impl(const std::vector<Link*> link_list);
+  static std::vector<kernel::resource::LinkImpl*> get_link_list_impl(const std::vector<Link*>& link_list);
 };
 
 // External constructors so that the types (and the types of their content) remain hidden
index 97bbfc6..89d4c8f 100644 (file)
@@ -18,9 +18,9 @@ using EventSet = std::deque<UnfoldingEvent*>;
 class EvtSetTools {
 public:
   static bool contains(const EventSet& events, const UnfoldingEvent* e);
-  static UnfoldingEvent* find(const EventSet events, const UnfoldingEvent* e);
+  static UnfoldingEvent* find(const EventSet& events, const UnfoldingEvent* e);
   static void subtract(EventSet& events, EventSet const& otherSet);
-  static bool depends(EventSet const& events, EventSet const& otherSet);
+  static bool depends(const EventSet& events, const EventSet& otherSet);
   static bool isEmptyIntersection(EventSet evtS1, EventSet evtS2);
   static EventSet makeUnion(const EventSet& s1, const EventSet& s2);
   static void pushBack(EventSet& events, UnfoldingEvent* e);
index 90dedc8..17ac925 100644 (file)
@@ -99,7 +99,7 @@ int NetZone::add_component(kernel::routing::NetPoint* elm)
   return pimpl_->add_component(elm);
 }
 
-std::vector<kernel::resource::LinkImpl*> NetZone::get_link_list_impl(const std::vector<Link*> link_list)
+std::vector<kernel::resource::LinkImpl*> NetZone::get_link_list_impl(const std::vector<Link*>& link_list)
 {
   std::vector<kernel::resource::LinkImpl*> links;
   for (const auto& link : link_list) {