Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove unnecessary calls to c_str().
[simgrid.git] / teshsuite / s4u / comm-pt2pt / comm-pt2pt.cpp
index 91d68f6..bc625c9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2010-2019. 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. */
@@ -49,7 +49,7 @@ static void sender(std::vector<std::string> args)
   for (unsigned int test = 1; test <= args[0].size(); test++) {
     simgrid::s4u::this_actor::sleep_until(test * 5 - 5);
     std::string* mboxName         = new std::string("Test #" + std::to_string(test));
-    simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::by_name(mboxName->c_str());
+    simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::by_name(*mboxName);
 
     switch (args[0][test - 1]) {
       case 'r':
@@ -96,7 +96,7 @@ static void receiver(std::vector<std::string> args)
   for (unsigned int test = 1; test <= args[0].size(); test++) {
     simgrid::s4u::this_actor::sleep_until(test * 5 - 5);
     std::string mboxName          = "Test #" + std::to_string(test);
-    simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::by_name(mboxName.c_str());
+    simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::by_name(mboxName);
     void* received                = nullptr;
 
     switch (args[0][test - 1]) {