[Libreoffice-commits] core.git: vcl/source

Adrien Ollier (via logerrit) logerrit at kemper.freedesktop.org
Sun May 5 06:04:17 UTC 2019


 vcl/source/animate/Animation.cxx |   15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

New commits:
commit 007d6b5b9e7c94ab93b2798f832467c26291cf31
Author:     Adrien Ollier <adr.ollier at hotmail.fr>
AuthorDate: Sun May 5 01:06:41 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun May 5 08:03:30 2019 +0200

    using STL and lambda expressions is better
    
    Change-Id: I0224dccb130ead02da46f2376b3df5ec889f8e8c
    Signed-off-by: Adrien Ollier <adr.ollier at hotmail.fr>
    Reviewed-on: https://gerrit.libreoffice.org/71812
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

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())
     {


More information about the Libreoffice-commits mailing list