From: Zac Medico Date: Mon, 21 Aug 2017 20:30:53 +0000 (-0700) Subject: PGPool::update: optimize with interval_set.swap X-Git-Tag: v12.2.9~118^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d68cff3deae6294f53f21606b81f0cfaeb76b271;p=ceph.git PGPool::update: optimize with interval_set.swap Use constant complexity swap instead of linear complexity assignment. Signed-off-by: Zac Medico (cherry picked from commit ae64179a63351ac3966e70a074776188ddba5b84) --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 9e45796b89a7..04f2d92828d9 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -247,7 +247,7 @@ void PGPool::update(OSDMapRef map) lgeneric_subdout(cct, osd, 0) << __func__ << " cached_removed_snaps shrank from " << cached_removed_snaps << " to " << newly_removed_snaps << dendl; - cached_removed_snaps = newly_removed_snaps; + cached_removed_snaps.swap(newly_removed_snaps); newly_removed_snaps.clear(); } snapc = pi->get_snap_context();