Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'simgrid-fork-plugin-photovoltaic'
[simgrid.git] / src / smpi / mpi / smpi_info.cpp
index b969e2a77a68477b4c56084e27693f566760af2a..0d696f479675ef9eb5cde42f6bceaf5f419efbcc 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -7,8 +7,7 @@
 #include "smpi_comm.hpp"
 #include "simgrid/Exception.hpp"
 
-namespace simgrid {
-namespace smpi {
+namespace simgrid::smpi {
 
 Info::Info(const Info* orig)
 {
@@ -33,8 +32,7 @@ void Info::unref(Info* info){
 int Info::get(const char* key, int valuelen, char* value, int* flag) const
 {
   *flag=false;
-  auto val = map_.find(key);
-  if (val != map_.end()) {
+  if (auto val = map_.find(key); val != map_.end()) {
     std::string tmpvalue = val->second;
 
     memset(value, 0, valuelen);
@@ -74,8 +72,7 @@ int Info::get_nthkey(int n, char* key) const
 int Info::get_valuelen(const char* key, int* valuelen, int* flag) const
 {
   *flag=false;
-  auto val = map_.find(key);
-  if (val != map_.end()) {
+  if (auto val = map_.find(key); val != map_.end()) {
     *valuelen = val->second.length();
     *flag=true;
   }
@@ -86,5 +83,4 @@ Info* Info::f2c(int id){
   return static_cast<Info*>(F2C::f2c(id));
 }
 
-}
-}
+} // namespace simgrid::smpi