]> AND Public Git Repository - simgrid.git/blobdiff - src/mc/sosp/ChunkedData.hpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix ExecImpl::get_remaining to return the right value when not started
[simgrid.git] / src / mc / sosp / ChunkedData.hpp
index 0f692c1f7198a71c622fee2c1e432df4fe8c49b7..85f07901de2580b9cb14b25107849e63fd7fd1ca 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2014-2021. 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. */
@@ -64,11 +64,13 @@ public:
   }
   ChunkedData& operator=(ChunkedData&& that) noexcept
   {
-    this->clear();
-    store_      = that.store_;
-    that.store_ = nullptr;
-    pagenos_    = std::move(that.pagenos_);
-    that.pagenos_.clear();
+    if (this != &that) {
+      this->clear();
+      store_      = that.store_;
+      that.store_ = nullptr;
+      pagenos_    = std::move(that.pagenos_);
+      that.pagenos_.clear();
+    }
     return *this;
   }