summaryrefslogtreecommitdiff
path: root/filter/source/graphicfilter/icgm/elements.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'filter/source/graphicfilter/icgm/elements.cxx')
-rw-r--r--filter/source/graphicfilter/icgm/elements.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/filter/source/graphicfilter/icgm/elements.cxx b/filter/source/graphicfilter/icgm/elements.cxx
index 8d324b68340c..915edc363630 100644
--- a/filter/source/graphicfilter/icgm/elements.cxx
+++ b/filter/source/graphicfilter/icgm/elements.cxx
@@ -320,12 +320,10 @@ Bundle* CGMElements::InsertBundle( BundleList& rList, Bundle& rBundle )
Bundle* pBundle = GetBundle( rList, rBundle.GetIndex() );
if ( pBundle )
{
- for ( BundleList::iterator it = rList.begin(); it != rList.end(); ++it ) {
- if ( it->get() == pBundle ) {
- rList.erase( it );
- break;
- }
- }
+ auto it = std::find_if(rList.begin(), rList.end(),
+ [&pBundle](const std::unique_ptr<Bundle>& rxBundle) { return rxBundle.get() == pBundle; });
+ if (it != rList.end())
+ rList.erase( it );
}
rList.push_back( rBundle.Clone() );
return rList.back().get();