Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Revalidate a tesh file (result of a merge error)
[simgrid.git] / examples / cpp / dag-scheduling / s4u-dag-scheduling.cpp
index da4e24b180ac7f97d7bf0dc045de825009d45f57..d20de088e1e962357b4785cb8d159a71a92f00d4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2009-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. */
@@ -225,8 +225,8 @@ int main(int argc, char** argv)
      * new dependency
      */
 
-    auto last_scheduled_task = sg_host_get_last_scheduled_task(selected_host);
-    if (last_scheduled_task && (last_scheduled_task->get_state() != sg4::Activity::State::FINISHED) &&
+    if (auto last_scheduled_task = sg_host_get_last_scheduled_task(selected_host);
+        last_scheduled_task && (last_scheduled_task->get_state() != sg4::Activity::State::FINISHED) &&
         (last_scheduled_task->get_state() != sg4::Activity::State::FAILED) &&
         not dependency_exists(sg_host_get_last_scheduled_task(selected_host), selected_task))
       last_scheduled_task->add_successor(selected_task);