Repository: mesos
Updated Branches:
  refs/heads/1.1.x c2cb47f78 -> e1b6b2145


Avoided passing `TimeInfo` by value.

Although this is likely to remain small in practice, passing by const
reference should be preferred until there is a reason not to.

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


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

Branch: refs/heads/1.1.x
Commit: 8cf2ca8703d3b776fdbdaac2979cbd3ea40873ad
Parents: c2cb47f
Author: Neil Conway <neil.con...@gmail.com>
Authored: Fri Oct 21 14:18:46 2016 -0700
Committer: Vinod Kone <vinodk...@gmail.com>
Committed: Tue Oct 25 12:19:11 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/mesos/blob/8cf2ca87/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 3c6b18e..7407bc9 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -5937,7 +5937,7 @@ void Master::markUnreachable(const SlaveID& slaveId)
 
 void Master::_markUnreachable(
     Slave* slave,
-    TimeInfo unreachableTime,
+    const TimeInfo& unreachableTime,
     const Future<bool>& registrarResult)
 {
   CHECK_NOTNULL(slave);
@@ -6281,7 +6281,7 @@ void Master::_reconcileTasks(
       // does not have the PARTITION_AWARE capability, send TASK_LOST
       // for backward compatibility. In either case, the status update
       // also includes the time when the slave was marked unreachable.
-      TimeInfo unreachableTime = slaves.unreachable[slaveId.get()];
+      const TimeInfo& unreachableTime = slaves.unreachable[slaveId.get()];
 
       TaskState taskState = TASK_UNREACHABLE;
       if (!protobuf::frameworkHasCapability(

http://git-wip-us.apache.org/repos/asf/mesos/blob/8cf2ca87/src/master/master.hpp
----------------------------------------------------------------------
diff --git a/src/master/master.hpp b/src/master/master.hpp
index 881f0d6..6e9865a 100644
--- a/src/master/master.hpp
+++ b/src/master/master.hpp
@@ -682,7 +682,7 @@ protected:
 
   void _markUnreachable(
       Slave* slave,
-      TimeInfo unreachableTime,
+      const TimeInfo& unreachableTime,
       const process::Future<bool>& registrarResult);
 
   // Mark a slave as unreachable in the registry. Called when the slave
@@ -1955,7 +1955,7 @@ private:
 class MarkSlaveUnreachable : public Operation
 {
 public:
-  MarkSlaveUnreachable(const SlaveInfo& _info, TimeInfo _unreachableTime)
+  MarkSlaveUnreachable(const SlaveInfo& _info, const TimeInfo& 
_unreachableTime)
     : info(_info), unreachableTime(_unreachableTime) {
     CHECK(info.has_id()) << "SlaveInfo is missing the 'id' field";
   }

Reply via email to