Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Use std::move with rvalue references.
[simgrid.git] / include / xbt / string.hpp
index 0169240..a8f2020 100644 (file)
@@ -91,8 +91,7 @@ public:
   string(string const& s) : string(s.c_str(), s.size()) {}
   string(string&& s)
   {
-    str.len    = s.str.len;
-    str.data   = s.str.data;
+    str        = std::move(s.str);
     s.str.len  = 0;
     s.str.data = &NUL;
   }