From 587ef41f75b8ea0bcd03366178d42a324dcf481c Mon Sep 17 00:00:00 2001 From: Arkadiy Illarionov Date: Sun, 18 Nov 2018 13:43:28 +0300 Subject: Simplify containers iterations in svx/source/[s-u]* Use range-based loop or replace with STL functions Change-Id: I2ec3e58cc46c9286ef863c732912ca7a729bab62 Reviewed-on: https://gerrit.libreoffice.org/63522 Tested-by: Jenkins Reviewed-by: Noel Grandin --- svx/source/svdraw/svdhdl.cxx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'svx/source/svdraw/svdhdl.cxx') diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index a53725c6ee1e..93621e714802 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -2184,13 +2184,9 @@ std::unique_ptr SdrHdlList::RemoveHdl(size_t nNum) void SdrHdlList::RemoveAllByKind(SdrHdlKind eKind) { - for(auto it = maList.begin(); it != maList.end(); ) - { - if ((*it)->GetKind() == eKind) - it = maList.erase( it ); - else - ++it; - } + maList.erase(std::remove_if(maList.begin(), maList.end(), + [&eKind](std::unique_ptr& rItem) { return rItem->GetKind() == eKind; }), + maList.end()); } void SdrHdlList::Clear() -- cgit