Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Concatenate nested namespaces (sonar).
[simgrid.git] / src / surf / network_ns3.cpp
index a3ad27a..cdef260 100644 (file)
@@ -308,8 +308,7 @@ static simgrid::config::Flag<std::string> ns3_seed(
     });
 
 namespace simgrid {
-namespace kernel {
-namespace resource {
+namespace kernel::resource {
 
 NetworkNS3Model::NetworkNS3Model(const std::string& name) : NetworkModel(name)
 {
@@ -322,8 +321,7 @@ NetworkNS3Model::NetworkNS3Model(const std::string& name) : NetworkModel(name)
   ns3::Config::SetDefault("ns3::TcpSocket::DelAckCount", ns3::UintegerValue(1));
   ns3::Config::SetDefault("ns3::TcpSocketBase::Timestamp", ns3::BooleanValue(false));
 
-  auto const& TcpProtocol = ns3_tcp_model.get();
-  if (TcpProtocol == "default") {
+  if (auto const& TcpProtocol = ns3_tcp_model.get(); TcpProtocol == "default") {
     /* nothing to do */
 
   } else if (TcpProtocol == "Reno" || TcpProtocol == "NewReno" || TcpProtocol == "Tahoe") {
@@ -571,8 +569,7 @@ void NetworkNS3Action::update_remains_lazy(double /*now*/)
   THROW_IMPOSSIBLE;
 }
 
-} // namespace resource
-} // namespace kernel
+} // namespace kernel::resource
 
 ns3::Ptr<ns3::Node> get_ns3node_from_sghost(const simgrid::s4u::Host* host)
 {