From: Jason Dillaman Date: Tue, 14 Apr 2020 22:05:59 +0000 (-0400) Subject: rbd-mirror: utilize structured binding in 'for' loop X-Git-Tag: v16.1.0~2588^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F34496%2Fhead;p=ceph.git rbd-mirror: utilize structured binding in 'for' loop Signed-off-by: Jason Dillaman --- diff --git a/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc b/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc index 7980f525491..091a40d5b2c 100644 --- a/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc +++ b/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc @@ -872,17 +872,14 @@ void Replayer::create_non_primary_snapshot() { // (re)build a full mapping from remote to local snap ids for all user // snapshots to support applying image state in the future - for (auto remote_snap_info_it = remote_image_ctx->snap_info.begin(); - remote_snap_info_it != remote_image_ctx->snap_info.end(); - ++remote_snap_info_it) { - auto remote_snap_id = remote_snap_info_it->first; + for (auto& [remote_snap_id, remote_snap_info] : + remote_image_ctx->snap_info) { if (remote_snap_id >= m_remote_snap_id_end) { break; } // we can ignore all non-user snapshots since image state only includes // user snapshots - auto& remote_snap_info = remote_snap_info_it->second; if (boost::get( &remote_snap_info.snap_namespace) == nullptr) { continue;