Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove explicit conversion to std::string when it's not required.
[simgrid.git] / examples / cpp / synchro-condition-variable / s4u-synchro-condition-variable.cpp
index 2805c7c..07edf8a 100644 (file)
@@ -14,10 +14,10 @@ bool done = false;
 
 static void worker_fun(sg4::ConditionVariablePtr cv, sg4::MutexPtr mutex)
 {
-  std::unique_lock<sg4::Mutex> lock(*mutex);
+  std::unique_lock lock(*mutex);
 
   XBT_INFO("Start processing data which is '%s'.", data.c_str());
-  data += std::string(" after processing");
+  data += " after processing";
 
   // Send data back to main()
   XBT_INFO("Signal to master that the data processing is completed, and exit.");
@@ -30,7 +30,7 @@ static void master_fun()
 {
   auto mutex  = sg4::Mutex::create();
   auto cv     = sg4::ConditionVariable::create();
-  data        = std::string("Example data");
+  data        = "Example data";
   auto worker = sg4::Actor::create("worker", sg4::Host::by_name("Jupiter"), worker_fun, cv, mutex);
 
   // wait for the worker