summaryrefslogtreecommitdiffstats
path: root/desktop
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-09-24 12:12:12 +0200
committerLuboš Luňák <l.lunak@collabora.com>2021-09-28 13:47:25 +0200
commit6eac17ddcb25765f395493526e75c979049c73e2 (patch)
treeb6a576a67b5da553a1b255fcd9e8adb987a0ba5b /desktop
parentdo not check a const variable in every lambda invocation (diff)
downloadcore-6eac17ddcb25765f395493526e75c979049c73e2.tar.gz
core-6eac17ddcb25765f395493526e75c979049c73e2.zip
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>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx13
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);