Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove MSG. Its EOL was scheduled for 2020
[simgrid.git] / include / simgrid / plugins / ProducerConsumer.hpp
index 004afcb..c45563f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2021-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. */
@@ -75,7 +75,7 @@ private:
   {
     xbt_assert(max_queue_size > 0, "Max queue size of 0 is not allowed");
 
-    id = std::string("ProducerConsumer") + std::to_string(pc_id);
+    id = "ProducerConsumer" + std::to_string(pc_id);
     pc_id++;
 
     mutex_   = s4u::Mutex::create();
@@ -205,8 +205,7 @@ public:
   T* get()
   {
     T* data;
-    s4u::CommPtr comm = get_async(&data);
-    if (comm) {
+    if (s4u::CommPtr comm = get_async(&data)) {
       XBT_CDEBUG(producer_consumer, "Waiting for the data to arrive");
       comm->wait();
     }