diff options
author | Adrien Ollier <adr.ollier@hotmail.fr> | 2019-05-05 01:06:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-05-05 08:03:30 +0200 |
commit | 007d6b5b9e7c94ab93b2798f832467c26291cf31 (patch) | |
tree | a8b3ccbfcde55bbb5a48d9270348421a1193dc99 /vcl | |
parent | 00221089800c29aa71079d72d81e11fc889a7054 (diff) |
using STL and lambda expressions is better
Change-Id: I0224dccb130ead02da46f2376b3df5ec889f8e8c
Signed-off-by: Adrien Ollier <adr.ollier@hotmail.fr>
Reviewed-on: https://gerrit.libreoffice.org/71812
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/animate/Animation.cxx | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/vcl/source/animate/Animation.cxx b/vcl/source/animate/Animation.cxx index 9462d0e75a74..1382178aa6a0 100644 --- a/vcl/source/animate/Animation.cxx +++ b/vcl/source/animate/Animation.cxx @@ -229,16 +229,11 @@ bool Animation::Start(OutputDevice* pOut, const Point& rDestPt, const Size& rDes void Animation::Stop(OutputDevice* pOut, long nExtraData) { - for (size_t i = 0; i < maViewList.size();) - { - ImplAnimView* pView = maViewList[i].get(); - if (pView->matches(pOut, nExtraData)) - { - maViewList.erase(maViewList.begin() + i); - } - else - i++; - } + maViewList.erase(std::remove_if(maViewList.begin(), maViewList.end(), + [=](const std::unique_ptr<ImplAnimView>& pAnimView) -> bool { + return pAnimView->matches(pOut, nExtraData); + }), + maViewList.end()); if (maViewList.empty()) { |