diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2021-09-24 12:12:12 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2021-09-28 13:47:25 +0200 |
commit | 6eac17ddcb25765f395493526e75c979049c73e2 (patch) | |
tree | b6a576a67b5da553a1b255fcd9e8adb987a0ba5b | |
parent | 6a1aa5ba0be05258b6375433a071389811efd405 (diff) |
do not use std::find_if() if std::find() does the job
Change-Id: I94fe697e18442c1bce5e09abf82e8fe4b89cd0dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122675
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r-- | desktop/source/lib/init.cxx | 13 |
1 files changed, 4 insertions, 9 deletions
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); |