summaryrefslogtreecommitdiffstats
path: root/src/osd/OSDMap.cc
diff options
context:
space:
mode:
authorAdam C. Emerson <aemerson@redhat.com>2020-07-17 06:43:34 +0200
committerAdam C. Emerson <aemerson@redhat.com>2020-07-17 20:17:39 +0200
commit62a489d2c543c52d876d64999a4260153f279b0a (patch)
tree445130a62a47b80f8b504abebe9fe10ff5f23d83 /src/osd/OSDMap.cc
parentosd/OSDMap: Fix implicit conversion warning (diff)
downloadceph-62a489d2c543c52d876d64999a4260153f279b0a.tar.xz
ceph-62a489d2c543c52d876d64999a4260153f279b0a.zip
osd/OSDMap: Use reference to avoid copying in loop initializer
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Diffstat (limited to '')
-rw-r--r--src/osd/OSDMap.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc
index 2601500347b..ba31acdab2c 100644
--- a/src/osd/OSDMap.cc
+++ b/src/osd/OSDMap.cc
@@ -2800,7 +2800,7 @@ void OSDMap::encode_client_old(ceph::buffer::list& bl) const
// for encode(pg_temp, bl);
n = pg_temp->size();
encode(n, bl);
- for (const auto pg : *pg_temp) {
+ for (const auto& pg : *pg_temp) {
old_pg_t opg = pg.first.get_old_pg();
encode(opg, bl);
encode(pg.second, bl);
@@ -3819,7 +3819,7 @@ void OSDMap::print(ostream& out) const
out << "pg_upmap_items " << p.first << " " << p.second << "\n";
}
- for (const auto pg : *pg_temp)
+ for (const auto& pg : *pg_temp)
out << "pg_temp " << pg.first << " " << pg.second << "\n";
for (const auto pg : *primary_temp)