Captured alias variables by const ref in the Master.

Mainly done for consistency in this file rather than for
performance benefits.

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


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

Branch: refs/heads/master
Commit: fc858127cbec1ba2ce15ec86efd272b487a442a7
Parents: ac4cc53
Author: Anand Mazumdar <an...@apache.org>
Authored: Mon Jun 13 16:59:55 2016 -0700
Committer: Anand Mazumdar <an...@apache.org>
Committed: Mon Jun 13 17:12:05 2016 -0700

----------------------------------------------------------------------
 src/master/master.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/fc858127/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index dd80367..1971e9b 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -4338,8 +4338,8 @@ void Master::acknowledge(
 
   metrics->messages_status_update_acknowledgement++;
 
-  const SlaveID slaveId = acknowledge.slave_id();
-  const TaskID taskId = acknowledge.task_id();
+  const SlaveID& slaveId = acknowledge.slave_id();
+  const TaskID& taskId = acknowledge.task_id();
   const UUID uuid = UUID::fromBytes(acknowledge.uuid());
 
   Slave* slave = slaves.registered.get(slaveId);
@@ -5069,14 +5069,14 @@ void Master::updateSlave(
   // First, rescind any outstanding offers with revocable resources.
   // NOTE: Need a copy of offers because the offers are removed inside the 
loop.
   foreach (Offer* offer, utils::copy(slave->offers)) {
-    const Resources offered = offer->resources();
+    const Resources& offered = offer->resources();
     if (!offered.revocable().empty()) {
       LOG(INFO) << "Removing offer " << offer->id()
                 << " with revocable resources " << offered
                 << " on agent " << *slave;
 
       allocator->recoverResources(
-          offer->framework_id(), offer->slave_id(), offer->resources(), 
None());
+          offer->framework_id(), offer->slave_id(), offered, None());
 
       removeOffer(offer, true); // Rescind.
     }

Reply via email to