Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't give write permissions to others with mkdir.
[simgrid.git] / src / xbt / log.cpp
index 2852cf8e955365a091d4b6628e187caef7eed8d9..916c77baf1a5284ded0d74c08ce6f0486ae4c953 100644 (file)
@@ -280,9 +280,9 @@ int _xbt_log_cat_init(xbt_log_category_t category, e_xbt_log_priority_t priority
   }
 
   /* Apply the control */
-  auto iset = std::find_if(begin(xbt_log_settings()), end(xbt_log_settings()),
-                           [category](const xbt_log_setting_t& s) { return s.catname == category->name; });
-  if (iset != xbt_log_settings().end()) {
+  if (auto iset = std::find_if(begin(xbt_log_settings()), end(xbt_log_settings()),
+                               [category](const xbt_log_setting_t& s) { return s.catname == category->name; });
+      iset != xbt_log_settings().end()) {
     _xbt_log_cat_apply_set(category, *iset);
     xbt_log_settings().erase(iset);
   } else {