comphelper/source/misc/asyncnotification.cxx |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 450edc617aa28b003f02204a1748986a21da3ddf
Author:     AmandaQuaresmaCoutinho <quaresmaaman...@gmail.com>
AuthorDate: Tue Apr 9 19:18:39 2024 +0200
Commit:     Hossein <hoss...@libreoffice.org>
CommitDate: Wed May 15 18:16:52 2024 +0200

    tdf#158337 Use C++20 std::erase instead of std::remove followed by erase
    
    Change-Id: Ia75e19d21f0566ba589974bc2bad6da77c6252e7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165925
    Reviewed-by: Hossein <hoss...@libreoffice.org>
    Tested-by: Hossein <hoss...@libreoffice.org>

diff --git a/comphelper/source/misc/asyncnotification.cxx 
b/comphelper/source/misc/asyncnotification.cxx
index 72c6414e7281..697954de0bc1 100644
--- a/comphelper/source/misc/asyncnotification.cxx
+++ b/comphelper/source/misc/asyncnotification.cxx
@@ -204,12 +204,10 @@ namespace comphelper
         std::scoped_lock g(GetTheNotifiersMutex());
         // note: this doesn't happen atomically with the refcount
         // hence it's possible this deletes > 1 or 0 elements
-        g_Notifiers.erase(
-            std::remove_if(g_Notifiers.begin(), g_Notifiers.end(),
+        std::erase_if(g_Notifiers,
                 [](std::weak_ptr<AsyncEventNotifierAutoJoin> const& w) {
                     return w.expired();
-                } ),
-            g_Notifiers.end());
+                });
     }
 
     std::shared_ptr<AsyncEventNotifierAutoJoin>

Reply via email to