You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2015/06/02 16:54:38 UTC

[4/4] mesos git commit: Fix capture by reference of temporaries in Libprocess.

Fix capture by reference of temporaries in Libprocess.

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


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

Branch: refs/heads/master
Commit: 36ec7f22da3cceeeeec339eba62affa2bff69fac
Parents: ae506bc
Author: Joris Van Remoortere <jo...@gmail.com>
Authored: Tue Jun 2 07:54:17 2015 -0700
Committer: Benjamin Hindman <be...@gmail.com>
Committed: Tue Jun 2 07:54:19 2015 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/include/process/check.hpp   | 8 ++++----
 3rdparty/libprocess/include/process/gmock.hpp   | 2 +-
 3rdparty/libprocess/src/http.cpp                | 6 +++---
 3rdparty/libprocess/src/process.cpp             | 2 +-
 3rdparty/libprocess/src/tests/process_tests.cpp | 2 +-
 3rdparty/libprocess/src/tests/reap_tests.cpp    | 2 +-
 6 files changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/36ec7f22/3rdparty/libprocess/include/process/check.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/check.hpp b/3rdparty/libprocess/include/process/check.hpp
index b3f9690..60989ac 100644
--- a/3rdparty/libprocess/include/process/check.hpp
+++ b/3rdparty/libprocess/include/process/check.hpp
@@ -25,25 +25,25 @@
 // This appends the error if possible to the end of the log message, so there's
 // no need to append the error message explicitly.
 #define CHECK_PENDING(expression)                                       \
-  for (const Option<std::string>& _error = _checkPending(expression);   \
+  for (const Option<std::string> _error = _checkPending(expression);    \
        _error.isSome();)                                                \
     _CheckFatal(__FILE__, __LINE__, "CHECK_PENDING",                    \
                 #expression, _error.get()).stream()
 
 #define CHECK_READY(expression)                                         \
-  for (const Option<std::string>& _error = _checkReady(expression);     \
+  for (const Option<std::string> _error = _checkReady(expression);      \
        _error.isSome();)                                                \
     _CheckFatal(__FILE__, __LINE__, "CHECK_READY",                      \
                 #expression, _error.get()).stream()
 
 #define CHECK_DISCARDED(expression)                                     \
-  for (const Option<std::string>& _error = _checkDiscarded(expression); \
+  for (const Option<std::string> _error = _checkDiscarded(expression);  \
        _error.isSome();)                                                \
     _CheckFatal(__FILE__, __LINE__, "CHECK_DISCARDED",                  \
                 #expression, _error.get()).stream()
 
 #define CHECK_FAILED(expression)                                        \
-  for (const Option<std::string>& _error = _checkFailed(expression);    \
+  for (const Option<std::string> _error = _checkFailed(expression);     \
        _error.isSome();)                                                \
     _CheckFatal(__FILE__, __LINE__, "CHECK_FAILED",                     \
                 #expression, _error.get()).stream()

http://git-wip-us.apache.org/repos/asf/mesos/blob/36ec7f22/3rdparty/libprocess/include/process/gmock.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/gmock.hpp b/3rdparty/libprocess/include/process/gmock.hpp
index a99eb8a..6adc034 100644
--- a/3rdparty/libprocess/include/process/gmock.hpp
+++ b/3rdparty/libprocess/include/process/gmock.hpp
@@ -162,7 +162,7 @@ private:
     virtual typename ::testing::ActionInterface<F>::Result Perform(
         const typename ::testing::ActionInterface<F>::ArgumentTuple& args)
     {
-      const typename ::testing::ActionInterface<F>::Result& result =
+      const typename ::testing::ActionInterface<F>::Result result =
         action.Perform(args);
       promise.set(result);
       return result;

http://git-wip-us.apache.org/repos/asf/mesos/blob/36ec7f22/3rdparty/libprocess/src/http.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/http.cpp b/3rdparty/libprocess/src/http.cpp
index 67983ee..1d318b9 100644
--- a/3rdparty/libprocess/src/http.cpp
+++ b/3rdparty/libprocess/src/http.cpp
@@ -134,7 +134,7 @@ bool Request::accepts(const string& encoding) const
     foreach (const string& _encoding, strings::tokenize(accepted.get(), ",")) {
       if (strings::startsWith(_encoding, candidate)) {
         // Is there a 0 q value? Ex: 'gzip;q=0.0'.
-        const map<string, vector<string>>& values =
+        const map<string, vector<string>> values =
           strings::pairs(_encoding, ";", "=");
 
         // Look for { "q": ["0"] }.
@@ -474,9 +474,9 @@ Try<hashmap<std::string, std::string>> decode(const std::string& query)
 {
   hashmap<std::string, std::string> result;
 
-  const std::vector<std::string>& tokens = strings::tokenize(query, ";&");
+  const std::vector<std::string> tokens = strings::tokenize(query, ";&");
   foreach (const std::string& token, tokens) {
-    const std::vector<std::string>& pairs = strings::split(token, "=", 2);
+    const std::vector<std::string> pairs = strings::split(token, "=", 2);
     if (pairs.size() == 0) {
       continue;
     }

http://git-wip-us.apache.org/repos/asf/mesos/blob/36ec7f22/3rdparty/libprocess/src/process.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/process.cpp b/3rdparty/libprocess/src/process.cpp
index 304e877..4a5ab79 100644
--- a/3rdparty/libprocess/src/process.cpp
+++ b/3rdparty/libprocess/src/process.cpp
@@ -558,7 +558,7 @@ void decode_recv(
   }
 
   // Decode as much of the data as possible into HTTP requests.
-  deque<Request*> requests = decoder->decode(data, length.get());
+  const deque<Request*> requests = decoder->decode(data, length.get());
 
   if (!requests.empty()) {
     foreach (Request* request, requests) {

http://git-wip-us.apache.org/repos/asf/mesos/blob/36ec7f22/3rdparty/libprocess/src/tests/process_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/tests/process_tests.cpp b/3rdparty/libprocess/src/tests/process_tests.cpp
index 0d8a87b..7b9ba9e 100644
--- a/3rdparty/libprocess/src/tests/process_tests.cpp
+++ b/3rdparty/libprocess/src/tests/process_tests.cpp
@@ -1641,7 +1641,7 @@ public:
 
 TEST(Process, provide)
 {
-  const Try<string>& mkdtemp = os::mkdtemp();
+  const Try<string> mkdtemp = os::mkdtemp();
   ASSERT_SOME(mkdtemp);
 
   const string LOREM_IPSUM =

http://git-wip-us.apache.org/repos/asf/mesos/blob/36ec7f22/3rdparty/libprocess/src/tests/reap_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/tests/reap_tests.cpp b/3rdparty/libprocess/src/tests/reap_tests.cpp
index a18d54c..51a570f 100644
--- a/3rdparty/libprocess/src/tests/reap_tests.cpp
+++ b/3rdparty/libprocess/src/tests/reap_tests.cpp
@@ -146,7 +146,7 @@ TEST(Reap, TerminatedChildProcess)
   // Make sure the process is transitioned into the zombie
   // state before we reap it.
   while (true) {
-    const Result<os::Process>& process = os::process(child);
+    const Result<os::Process> process = os::process(child);
     ASSERT_SOME(process) << "Process " << child << " reaped unexpectedly";
 
     if (process.get().zombie) {