Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
No need to check for activities_ nullness
[simgrid.git] / src / surf / disk_s19.cpp
index e638f1f..a6f894f 100644 (file)
@@ -27,9 +27,7 @@ void surf_disk_model_init_default()
   engine->get_netzone_root()->set_disk_model(disk_model);
 }
 
-namespace simgrid {
-namespace kernel {
-namespace resource {
+namespace simgrid::kernel::resource {
 
 DiskImpl* DiskS19Model::create_disk(const std::string& name, double read_bandwidth, double write_bandwidth)
 {
@@ -65,8 +63,7 @@ DiskAction* DiskS19Model::io_start(const DiskImpl* disk, sg_size_t size, s4u::Io
     default:
       THROW_UNIMPLEMENTED;
   }
-  const auto& factor_cb = disk->get_factor_cb();
-  if (factor_cb) { // handling disk variability
+  if (const auto& factor_cb = disk->get_factor_cb()) { // handling disk variability
     action->set_rate_factor(factor_cb(size, type));
   }
   return action;
@@ -135,6 +132,4 @@ void DiskS19Action::update_remains_lazy(double /*now*/)
 {
   THROW_IMPOSSIBLE;
 }
-} // namespace resource
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::resource