Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Cosmetics.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 14 Oct 2020 15:29:56 +0000 (17:29 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 14 Oct 2020 15:29:56 +0000 (17:29 +0200)
Better than: if ((variable == true) != false) ...

src/kernel/routing/DijkstraZone.cpp
src/kernel/routing/FloydZone.cpp
src/kernel/routing/FullZone.cpp
src/smpi/internals/smpi_global.cpp
src/smpi/mpi/smpi_op.cpp
src/surf/network_wifi.cpp
src/surf/ns3/ns3_simulator.cpp

index ecd5ac3..cebdab7 100644 (file)
@@ -229,7 +229,7 @@ void DijkstraZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, Net
 
   new_edge(src->id(), dst->id(), new_extended_route(hierarchy_, gw_src, gw_dst, link_list, true));
 
-  if (symmetrical == true)
+  if (symmetrical)
     new_edge(dst->id(), src->id(), new_extended_route(hierarchy_, gw_dst, gw_src, link_list, false));
 }
 
index de725b3..34d9b20 100644 (file)
@@ -121,7 +121,7 @@ void FloydZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoi
   TO_FLOYD_PRED(src->id(), dst->id()) = src->id();
   TO_FLOYD_COST(src->id(), dst->id()) = (TO_FLOYD_LINK(src->id(), dst->id()))->link_list.size();
 
-  if (symmetrical == true) {
+  if (symmetrical) {
     if (gw_dst) // netzone route (to adapt the error message, if any)
       xbt_assert(
           nullptr == TO_FLOYD_LINK(dst->id(), src->id()),
index 37bf653..6c3bb86 100644 (file)
@@ -95,7 +95,7 @@ void FullZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoin
   /* Add the route to the base */
   TO_ROUTE_FULL(src->id(), dst->id()) = new_extended_route(hierarchy_, gw_src, gw_dst, link_list, true);
 
-  if (symmetrical == true && src != dst) {
+  if (symmetrical && src != dst) {
     if (gw_dst && gw_src) {
       NetPoint* gw_tmp = gw_src;
       gw_src           = gw_dst;
index d578f01..1c23f4c 100644 (file)
@@ -489,7 +489,7 @@ static void smpi_init_privatization_dlopen(const std::string& executable)
       // Load the copy and resolve the entry point:
       void* handle    = dlopen(target_executable.c_str(), RTLD_LAZY | RTLD_LOCAL | WANT_RTLD_DEEPBIND);
       int saved_errno = errno;
-      if (simgrid::config::get_value<bool>("smpi/keep-temps") == false) {
+      if (not simgrid::config::get_value<bool>("smpi/keep-temps")) {
         unlink(target_executable.c_str());
         for (const std::string& target_lib : target_libs)
           unlink(target_lib.c_str());
index 3ae327d..a94b2ff 100644 (file)
@@ -270,7 +270,7 @@ void Op::ref(){
 void Op::unref(MPI_Op* op){
   if((*op)!=MPI_OP_NULL){
     (*op)->refcount_--;
-    if((*op)->refcount_==0 && (*op)->predefined_==false)
+    if ((*op)->refcount_ == 0 && not (*op)->predefined_)
       delete(*op);
   }
 }
index 1eba216..eee2759 100644 (file)
@@ -30,7 +30,7 @@ NetworkWifiLink::NetworkWifiLink(NetworkCm02Model* model, const std::string& nam
 void NetworkWifiLink::set_host_rate(const s4u::Host* host, int rate_level)
 {
   auto insert_done = host_rates_.insert(std::make_pair(host->get_name(), rate_level));
-  if (insert_done.second == false)
+  if (not insert_done.second)
     insert_done.first->second = rate_level;
 
   // Each time we add a host, we refresh the decay model
index 4b7e9b6..fe3c363 100644 (file)
@@ -48,7 +48,7 @@ static void receive_callback(ns3::Ptr<ns3::Socket> socket)
   SgFlow* flow = getFlowFromSocket(socket);
   XBT_DEBUG("received on F[%p, total: %u, remain: %u]", flow, flow->total_bytes_, flow->remaining_);
 
-  if (flow->finished_ == false) {
+  if (not flow->finished_) {
     flow->finished_ = true;
     XBT_DEBUG("recv_cb of F[%p, %p, %u]", flow, flow->action_, flow->total_bytes_);
     XBT_DEBUG("Stop simulator at %f seconds", ns3::Simulator::Now().GetSeconds());