You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2016/10/13 05:57:39 UTC

[3/3] mesos git commit: Removed two std::move in MountInfoTable::read.

Removed two std::move in MountInfoTable::read.

Review: https://reviews.apache.org/r/51620/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/0ab140ba
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/0ab140ba
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/0ab140ba

Branch: refs/heads/1.0.x
Commit: 0ab140bacc3642deebc1c64af00ddaf8a3393d9c
Parents: 1f04aee
Author: Jie Yu <yu...@gmail.com>
Authored: Wed Oct 12 22:49:45 2016 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Wed Oct 12 22:56:12 2016 -0700

----------------------------------------------------------------------
 src/linux/fs.cpp | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/0ab140ba/src/linux/fs.cpp
----------------------------------------------------------------------
diff --git a/src/linux/fs.cpp b/src/linux/fs.cpp
index 1cb329a..978953f 100644
--- a/src/linux/fs.cpp
+++ b/src/linux/fs.cpp
@@ -126,7 +126,7 @@ Try<MountInfoTable> MountInfoTable::read(
       if (entry.target == "/") {
         rootParentId = entry.parent;
       }
-      parentToChildren[entry.parent].push_back(std::move(entry));
+      parentToChildren[entry.parent].push_back(entry);
     }
 
     // Walk the hashmap and construct a list of entries sorted
@@ -144,8 +144,7 @@ Try<MountInfoTable> MountInfoTable::read(
       visitedParents.insert(parentId);
 
       foreach (const MountInfoTable::Entry& entry, parentToChildren[parentId]) {
-        int newParentId = entry.id;
-        sortedEntries.push_back(std::move(entry));
+        sortedEntries.push_back(entry);
 
         // It is legal to have a `MountInfoTable` entry whose
         // `entry.id` is the same as its `entry.parent`. This can
@@ -153,8 +152,8 @@ Try<MountInfoTable> MountInfoTable::read(
         // and then keeps the original `/` in RAM. To avoid cycles
         // when walking the mount hierarchy, we only recurse into our
         // children if this case is not satisfied.
-        if (parentId != newParentId) {
-          sortFrom(newParentId);
+        if (parentId != entry.id) {
+          sortFrom(entry.id);
         }
       }
     };