You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by an...@apache.org on 2016/11/20 20:21:50 UTC

mesos git commit: Avoided unnecessary copies of `HttpConnection`.

Repository: mesos
Updated Branches:
  refs/heads/master d2ab4b49d -> 2abf2f7b3


Avoided unnecessary copies of `HttpConnection`.

This fixes two places where we were needlessly copying an
`HttpConnection`. Aside from the performance consequences, making a copy
suggests to the reader that a copy is semantically necessary, which is
not the case here.

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


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

Branch: refs/heads/master
Commit: 2abf2f7b3a715e4a92a573901d1dc1a334d5ebfd
Parents: d2ab4b4
Author: Neil Conway <ne...@gmail.com>
Authored: Mon Nov 21 04:19:47 2016 +0800
Committer: Anand Mazumdar <an...@apache.org>
Committed: Mon Nov 21 04:19:47 2016 +0800

----------------------------------------------------------------------
 src/master/master.cpp | 4 ++--
 src/master/master.hpp | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/2abf2f7b/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 7ed1d25..e03a2e8 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -6982,7 +6982,7 @@ void Master::addFramework(Framework* framework)
   } else {
     CHECK_SOME(framework->http);
 
-    HttpConnection http = framework->http.get();
+    const HttpConnection& http = framework->http.get();
 
     http.closed()
       .onAny(defer(self(), &Self::exited, framework->id(), http));
@@ -8368,7 +8368,7 @@ void Master::exited(const UUID& id)
 }
 
 
-void Master::subscribe(HttpConnection http)
+void Master::subscribe(const HttpConnection& http)
 {
   LOG(INFO) << "Added subscriber: " << http.streamId << " to the "
             << "list of active subscribers";

http://git-wip-us.apache.org/repos/asf/mesos/blob/2abf2f7b/src/master/master.hpp
----------------------------------------------------------------------
diff --git a/src/master/master.hpp b/src/master/master.hpp
index 7829f3f..b6c610b 100644
--- a/src/master/master.hpp
+++ b/src/master/master.hpp
@@ -907,7 +907,7 @@ private:
       const process::Future<bool>& authorized);
 
   // Subscribes a client to the 'api/vX' endpoint.
-  void subscribe(HttpConnection http);
+  void subscribe(const HttpConnection& http);
 
   void teardown(Framework* framework);