Used {} instead of Hook::None() in libprocess [1/2].

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


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

Branch: refs/heads/master
Commit: 2af7e5ebae976735d263f45e540c886111d27982
Parents: 059f47b
Author: Joerg Schad <jo...@mesosphere.io>
Authored: Wed Sep 21 09:50:26 2016 -0700
Committer: Jie Yu <yujie....@gmail.com>
Committed: Wed Sep 21 09:50:26 2016 -0700

----------------------------------------------------------------------
 .../include/process/subprocess_base.hpp         | 22 ++++----------------
 1 file changed, 4 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/2af7e5eb/3rdparty/libprocess/include/process/subprocess_base.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/subprocess_base.hpp 
b/3rdparty/libprocess/include/process/subprocess_base.hpp
index 0502f96..99b13c6 100644
--- a/3rdparty/libprocess/include/process/subprocess_base.hpp
+++ b/3rdparty/libprocess/include/process/subprocess_base.hpp
@@ -170,11 +170,6 @@ public:
    */
   struct Hook
   {
-    /**
-     * Returns an empty list of hooks.
-     */
-    static std::vector<Hook> None() { return std::vector<Hook>(); }
-
     Hook(const lambda::function<Try<Nothing>(pid_t)>& _parent_callback);
 
     /**
@@ -212,11 +207,6 @@ public:
      */
     static ChildHook SETSID();
 
-    /**
-     * Returns an empty list of `ChildHooks`.
-     */
-    static std::vector<ChildHook> None() { return std::vector<ChildHook>(); }
-
     Try<Nothing> operator()() const { return child_setup(); }
 
   private:
@@ -385,10 +375,8 @@ Try<Subprocess> subprocess(
     const Option<std::map<std::string, std::string>>& environment = None(),
     const Option<lambda::function<
         pid_t(const lambda::function<int()>&)>>& clone = None(),
-    const std::vector<Subprocess::Hook>& parent_hooks =
-      Subprocess::Hook::None(),
-    const std::vector<Subprocess::ChildHook>& child_hooks =
-      Subprocess::ChildHook::None(),
+    const std::vector<Subprocess::Hook>& parent_hooks = {},
+    const std::vector<Subprocess::ChildHook>& child_hooks = {},
     const Watchdog watchdog = NO_MONITOR);
 
 
@@ -426,10 +414,8 @@ inline Try<Subprocess> subprocess(
     const Option<std::map<std::string, std::string>>& environment = None(),
     const Option<lambda::function<
         pid_t(const lambda::function<int()>&)>>& clone = None(),
-    const std::vector<Subprocess::Hook>& parent_hooks =
-      Subprocess::Hook::None(),
-    const std::vector<Subprocess::ChildHook>& child_hooks =
-      Subprocess::ChildHook::None(),
+    const std::vector<Subprocess::Hook>& parent_hooks = {},
+    const std::vector<Subprocess::ChildHook>& child_hooks = {},
     const Watchdog watchdog = NO_MONITOR)
 {
   std::vector<std::string> argv = {os::Shell::arg0, os::Shell::arg1, command};

Reply via email to