]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: Fix ranged-construct warning
authorAdam C. Emerson <aemerson@redhat.com>
Mon, 7 Mar 2022 23:46:04 +0000 (18:46 -0500)
committerMykola Golub <mgolub@suse.com>
Fri, 1 Mar 2024 12:09:15 +0000 (14:09 +0200)
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 <aemerson@redhat.com>
(cherry picked from commit da789f40cb72eb126741e229f4b0906b6b6dff52)

src/mon/OSDMonitor.cc

index 297d4b6c435017b6560dca471e7e54b022b382a5..74eb691f523111556ad93a02dbaf463b50ede685 100644 (file)
@@ -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);