From: Arnaud Giersch Date: Wed, 14 Oct 2020 15:29:56 +0000 (+0200) Subject: Cosmetics. X-Git-Tag: v3.26~304 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/3b2dbb5d7bb46fcea379d478c77df4de1910403c Cosmetics. Better than: if ((variable == true) != false) ... --- diff --git a/src/kernel/routing/DijkstraZone.cpp b/src/kernel/routing/DijkstraZone.cpp index ecd5ac396e..cebdab7000 100644 --- a/src/kernel/routing/DijkstraZone.cpp +++ b/src/kernel/routing/DijkstraZone.cpp @@ -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)); } diff --git a/src/kernel/routing/FloydZone.cpp b/src/kernel/routing/FloydZone.cpp index de725b3063..34d9b203b7 100644 --- a/src/kernel/routing/FloydZone.cpp +++ b/src/kernel/routing/FloydZone.cpp @@ -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()), diff --git a/src/kernel/routing/FullZone.cpp b/src/kernel/routing/FullZone.cpp index 37bf653231..6c3bb86774 100644 --- a/src/kernel/routing/FullZone.cpp +++ b/src/kernel/routing/FullZone.cpp @@ -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; diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index d578f01ff2..1c23f4c80d 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -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("smpi/keep-temps") == false) { + if (not simgrid::config::get_value("smpi/keep-temps")) { unlink(target_executable.c_str()); for (const std::string& target_lib : target_libs) unlink(target_lib.c_str()); diff --git a/src/smpi/mpi/smpi_op.cpp b/src/smpi/mpi/smpi_op.cpp index 3ae327d4cb..a94b2ff732 100644 --- a/src/smpi/mpi/smpi_op.cpp +++ b/src/smpi/mpi/smpi_op.cpp @@ -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); } } diff --git a/src/surf/network_wifi.cpp b/src/surf/network_wifi.cpp index 1eba216d39..eee27596c2 100644 --- a/src/surf/network_wifi.cpp +++ b/src/surf/network_wifi.cpp @@ -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 diff --git a/src/surf/ns3/ns3_simulator.cpp b/src/surf/ns3/ns3_simulator.cpp index 4b7e9b6f79..fe3c36376a 100644 --- a/src/surf/ns3/ns3_simulator.cpp +++ b/src/surf/ns3/ns3_simulator.cpp @@ -48,7 +48,7 @@ static void receive_callback(ns3::Ptr 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());