Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Address misc Sonar issues.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 21 Nov 2022 14:36:37 +0000 (15:36 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 21 Nov 2022 16:12:46 +0000 (17:12 +0100)
src/kernel/actor/ActorImpl.cpp
src/kernel/actor/ActorImpl.hpp
src/kernel/resource/WifiLinkImpl.hpp
src/mc/ModelChecker.hpp
src/mc/remote/AppSide.cpp

index be71dd3..b1cb37b 100644 (file)
@@ -34,8 +34,8 @@ ActorImpl* ActorImpl::self()
   return (self_context != nullptr) ? self_context->get_actor() : nullptr;
 }
 
-ActorImpl::ActorImpl(std::string name, s4u::Host* host, aid_t ppid)
-    : ActorIDTrait(std::move(name), ppid), host_(host), piface_(this)
+ActorImpl::ActorImpl(const std::string& name, s4u::Host* host, aid_t ppid)
+    : ActorIDTrait(name, ppid), host_(host), piface_(this)
 {
   simcall_.issuer_ = this;
   stacksize_       = context::stack_size;
index 044bbf5..8efbc18 100644 (file)
@@ -67,7 +67,7 @@ class XBT_PUBLIC ActorImpl : public xbt::PropertyHolder, public ActorIDTrait, pu
   friend activity::MailboxImpl;
 
 public:
-  ActorImpl(std::string name, s4u::Host* host, aid_t ppid);
+  ActorImpl(const std::string& name, s4u::Host* host, aid_t ppid);
   ActorImpl(const ActorImpl&) = delete;
   ActorImpl& operator=(const ActorImpl&) = delete;
   ~ActorImpl();
index 3036606..ad08b6c 100644 (file)
@@ -19,7 +19,7 @@ class XBT_PRIVATE WifiLinkAction;
 
 class WifiLinkImpl : public StandardLinkImpl {
   /** @brief Hold every rates association between host and links (host name, rates id) */
-  std::map<std::string, int> host_rates_;
+  std::map<std::string, int, std::less<>> host_rates_;
 
   /** @brief A link can have several bandwidths attached to it (mostly use by wifi model) */
   std::vector<Metric> bandwidths_;
index 504f682..ef560dd 100644 (file)
@@ -12,7 +12,6 @@
 #include "xbt/base.h"
 
 #include <memory>
-#include <set>
 
 namespace simgrid::mc {
 
@@ -20,8 +19,6 @@ namespace simgrid::mc {
  */
 class ModelChecker {
   CheckerSide checker_side_;
-  /** String pool for host names */
-  std::set<std::string, std::less<>> hostnames_;
   // This is the parent snapshot of the current state:
   PageStore page_store_{500};
   std::unique_ptr<RemoteProcess> remote_process_;
@@ -40,8 +37,6 @@ public:
   Channel& channel() { return checker_side_.get_channel(); }
   PageStore& page_store() { return page_store_; }
 
-  std::string const& get_host_name(const char* hostname) { return *this->hostnames_.insert(hostname).first; }
-
   void start();
   void shutdown();
   void resume();
index 56de882..fe481ca 100644 (file)
@@ -85,7 +85,7 @@ AppSide* AppSide::initialize()
 
 void AppSide::handle_deadlock_check(const s_mc_message_t*) const
 {
-  auto* engine           = kernel::EngineImpl::get_instance();
+  const auto* engine     = kernel::EngineImpl::get_instance();
   const auto& actor_list = engine->get_actor_list();
   bool deadlock = not actor_list.empty() && std::none_of(begin(actor_list), end(actor_list), [](const auto& kv) {
     return mc::actor_is_enabled(kv.second);