]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
client: Remove unneeded copies in ranged for
authorAdam C. Emerson <aemerson@redhat.com>
Fri, 17 Jul 2020 04:49:15 +0000 (00:49 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Fri, 17 Jul 2020 18:17:39 +0000 (14:17 -0400)
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/client/Client.cc

index 3bb4749808eee62e3382a01d4f634349fc9bfdb8..1e884075220f4028bd8e894fc713fa733a12801b 100755 (executable)
@@ -5704,7 +5704,7 @@ int Client::resolve_mds(
       return -ENOENT;
     }
 
-    for (const auto i : mds_info) {
+    for (const auto& i : mds_info) {
       targets->push_back(i.first);
     }
   } else {
@@ -5833,7 +5833,7 @@ int Client::mds_command(
   // If daemons are laggy, we won't send them commands.  If all
   // are laggy then we fail.
   std::vector<mds_gid_t> non_laggy;
-  for (const auto gid : targets) {
+  for (const auto& gid : targets) {
     const auto info = fsmap->get_info_gid(gid);
     if (!info.laggy()) {
       non_laggy.push_back(gid);
@@ -5852,7 +5852,7 @@ int Client::mds_command(
 
   // Send commands to targets
   C_GatherBuilder gather(cct, onfinish);
-  for (const auto target_gid : non_laggy) {
+  for (const auto& target_gid : non_laggy) {
     const auto info = fsmap->get_info_gid(target_gid);
 
     // Open a connection to the target MDS