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/08/09 16:42:47 UTC

[2/3] mesos git commit: Used hashset instead of set when sorting the mount table.

Used hashset instead of set when sorting the mount table.


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

Branch: refs/heads/1.0.x
Commit: 9a8870b0dcbd73c1f9f46e3c9b847abea7fba3e7
Parents: 8553160
Author: Jie Yu <yu...@gmail.com>
Authored: Tue Aug 9 09:25:21 2016 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Tue Aug 9 09:42:02 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/mesos/blob/9a8870b0/src/linux/fs.cpp
----------------------------------------------------------------------
diff --git a/src/linux/fs.cpp b/src/linux/fs.cpp
index 7953eff..0d025d3 100644
--- a/src/linux/fs.cpp
+++ b/src/linux/fs.cpp
@@ -29,6 +29,7 @@
 #include <stout/check.hpp>
 #include <stout/error.hpp>
 #include <stout/hashmap.hpp>
+#include <stout/hashset.hpp>
 #include <stout/numify.hpp>
 #include <stout/path.hpp>
 #include <stout/strings.hpp>
@@ -132,11 +133,11 @@ Try<MountInfoTable> MountInfoTable::read(
     // hierarchically. The recursion eventually terminates because
     // entries in MountInfoTable are guaranteed to have no cycles.
     // We double check though, just to make sure.
-    set<int> visitedParents;
+    hashset<int> visitedParents;
     vector<MountInfoTable::Entry> sortedEntries;
 
     std::function<void(int)> sortFrom = [&](int parentId) {
-      CHECK(visitedParents.count(parentId) == 0);
+      CHECK(!visitedParents.contains(parentId));
       visitedParents.insert(parentId);
 
       foreach (const MountInfoTable::Entry& entry, parentToChildren[parentId]) {