]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: utilize structured binding in 'for' loop 34496/head
authorJason Dillaman <dillaman@redhat.com>
Tue, 14 Apr 2020 22:05:59 +0000 (18:05 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 14 Apr 2020 22:05:59 +0000 (18:05 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc

index 7980f525491ce0c630145056177d89323a673523..091a40d5b2c6dedfc727f12b2089b63cecac0ae1 100644 (file)
@@ -872,17 +872,14 @@ void Replayer<I>::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<cls::rbd::UserSnapshotNamespace>(
             &remote_snap_info.snap_namespace) == nullptr) {
         continue;