Repository: mesos Updated Branches: refs/heads/master 01aa3ba4a -> f9dfbdac7
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/27eb6b7f Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/27eb6b7f Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/27eb6b7f Branch: refs/heads/master Commit: 27eb6b7faed68e83a6b713c4f69c958abba78100 Parents: 01aa3ba Author: Neil Conway <neil.con...@gmail.com> Authored: Fri Oct 21 14:18:46 2016 -0700 Committer: Vinod Kone <vinodk...@gmail.com> Committed: Fri Oct 21 14:18:46 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/27eb6b7f/src/master/master.cpp ---------------------------------------------------------------------- diff --git a/src/master/master.cpp b/src/master/master.cpp index a52adb3..500cca4 100644 --- a/src/master/master.cpp +++ b/src/master/master.cpp @@ -5979,7 +5979,7 @@ void Master::markUnreachable(const SlaveID& slaveId) void Master::_markUnreachable( Slave* slave, - TimeInfo unreachableTime, + const TimeInfo& unreachableTime, const Future<bool>& registrarResult) { CHECK_NOTNULL(slave); @@ -6327,7 +6327,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/27eb6b7f/src/master/master.hpp ---------------------------------------------------------------------- diff --git a/src/master/master.hpp b/src/master/master.hpp index 6d2db9d..41f8480 100644 --- a/src/master/master.hpp +++ b/src/master/master.hpp @@ -683,7 +683,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 @@ -1953,7 +1953,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"; }