desktop/source/lib/init.cxx |   13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

New commits:
commit 2b32ab3a32ce9fff42818a6813a041b356d324b8
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Fri Sep 24 12:12:12 2021 +0200
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Tue Sep 28 13:50:47 2021 +0200

    do not use std::find_if() if std::find() does the job
    
    Change-Id: I94fe697e18442c1bce5e09abf82e8fe4b89cd0dd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122642
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 73af13dd8910..824f45b5d23f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1529,8 +1529,7 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
         case LOK_CALLBACK_CALC_FUNCTION_LIST:
         case LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY:
         {
-            const auto& pos = std::find_if(m_queue1.rbegin(), m_queue1.rend(),
-                    [type] (int elemType) { return (elemType == type); });
+            const auto& pos = std::find(m_queue1.rbegin(), m_queue1.rend(), 
type);
             auto pos2 = toQueue2(pos);
             if (pos != m_queue1.rend() && pos2->PayloadString == payload)
             {
@@ -1543,14 +1542,12 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 
     if (type == LOK_CALLBACK_TEXT_SELECTION && payload.empty())
     {
-        const auto& posStart = std::find_if(m_queue1.rbegin(), m_queue1.rend(),
-                [] (int elemType) { return (elemType == 
LOK_CALLBACK_TEXT_SELECTION_START); });
+        const auto& posStart = std::find(m_queue1.rbegin(), m_queue1.rend(), 
LOK_CALLBACK_TEXT_SELECTION_START);
         auto posStart2 = toQueue2(posStart);
         if (posStart != m_queue1.rend())
             posStart2->PayloadString.clear();
 
-        const auto& posEnd = std::find_if(m_queue1.rbegin(), m_queue1.rend(),
-                [] (int elemType) { return (elemType == 
LOK_CALLBACK_TEXT_SELECTION_END); });
+        const auto& posEnd = std::find(m_queue1.rbegin(), m_queue1.rend(), 
LOK_CALLBACK_TEXT_SELECTION_END);
         auto posEnd2 = toQueue2(posEnd);
         if (posEnd != m_queue1.rend())
             posEnd2->PayloadString.clear();
@@ -1715,9 +1712,7 @@ bool 
CallbackFlushHandler::processInvalidateTilesEvent(int type, CallbackData& a
     // If we have to invalidate all tiles, we can skip any new tile 
invalidation.
     // Find the last INVALIDATE_TILES entry, if any to see if it's 
invalidate-all.
     const auto& pos
-        = std::find_if(m_queue1.rbegin(), m_queue1.rend(), [](int elemType) {
-              return (elemType == LOK_CALLBACK_INVALIDATE_TILES);
-          });
+        = std::find(m_queue1.rbegin(), m_queue1.rend(), 
LOK_CALLBACK_INVALIDATE_TILES);
     if (pos != m_queue1.rend())
     {
         auto pos2 = toQueue2(pos);

Reply via email to