[Libreoffice-commits] core.git: desktop/source
LuboÅ¡ LuÅák (via logerrit)
logerrit at kemper.freedesktop.org
Tue Sep 28 11:48:02 UTC 2021
desktop/source/lib/init.cxx | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
New commits:
commit 6eac17ddcb25765f395493526e75c979049c73e2
Author: Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Fri Sep 24 12:12:12 2021 +0200
Commit: Luboš Luňák <l.lunak at collabora.com>
CommitDate: Tue Sep 28 13:47:25 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/+/122675
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak at collabora.com>
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);
More information about the Libreoffice-commits
mailing list