From: Casey Bodley Date: Mon, 16 Nov 2015 21:42:51 +0000 (-0500) Subject: rgw: use std::move for strings in RGWFetchAllMetaCR X-Git-Tag: v10.1.0~354^2~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ea9f0fc374bb1509be98dcc9d37573c47397add2;p=ceph.git rgw: use std::move for strings in RGWFetchAllMetaCR Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_sync.cc b/src/rgw/rgw_sync.cc index 0279a94cb029..4c7e99618699 100644 --- a/src/rgw/rgw_sync.cc +++ b/src/rgw/rgw_sync.cc @@ -589,7 +589,7 @@ public: void append_section_from_set(set& all_sections, const string& name) { set::iterator iter = all_sections.find(name); if (iter != all_sections.end()) { - sections.push_back(name); + sections.emplace_back(std::move(*iter)); all_sections.erase(iter); } } @@ -599,17 +599,16 @@ public: */ void rearrange_sections() { set all_sections; - for (list::iterator iter = sections.begin(); iter != sections.end(); ++iter) { - all_sections.insert(*iter); - } + std::move(sections.begin(), sections.end(), + std::inserter(all_sections, all_sections.end())); sections.clear(); + append_section_from_set(all_sections, "user"); append_section_from_set(all_sections, "bucket.instance"); append_section_from_set(all_sections, "bucket"); - for (set::iterator iter = all_sections.begin(); iter != all_sections.end(); ++iter) { - sections.push_back(*iter); - } + std::move(all_sections.begin(), all_sections.end(), + std::back_inserter(sections)); } int operate() {