From 6eac17ddcb25765f395493526e75c979049c73e2 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Fri, 24 Sep 2021 12:12:12 +0200 Subject: do not use std::find_if() if std::find() does the job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I94fe697e18442c1bce5e09abf82e8fe4b89cd0dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122675 Tested-by: Jenkins Reviewed-by: Luboš Luňák --- desktop/source/lib/init.cxx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'desktop') diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 0677c0ccc5e7..9274be462370 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1523,8 +1523,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) { @@ -1537,14 +1536,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(); @@ -1709,9 +1706,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); -- cgit