From: Adam C. Emerson Date: Mon, 7 Mar 2022 23:46:04 +0000 (-0500) Subject: mon: Fix ranged-construct warning X-Git-Tag: v18.0.0~1192^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=da789f40cb72eb126741e229f4b0906b6b6dff52;p=ceph.git mon: Fix ranged-construct warning In the case of an uint32_t there's no benefit to a reference so just remove the const and make the copy. Signed-off-by: Adam C. Emerson --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index be1de29012b1..db9383e86076 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -899,13 +899,13 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap) t = MonitorDBStore::TransactionRef(); tx_size = 0; } - for (const auto [osd, state] : inc.new_state) { + for (auto [osd, state] : inc.new_state) { if (state & CEPH_OSD_UP) { // could be marked up *or* down, but we're too lazy to check which last_osd_report.erase(osd); } } - for (const auto [osd, weight] : inc.new_weight) { + for (auto [osd, weight] : inc.new_weight) { if (weight == CEPH_OSD_OUT) { // manually marked out, so drop it osd_epochs.erase(osd);