CppEditor: Pass function by reference

Coverity-Id: 1572606
Change-Id: Ia25fe956ebace7e77412971d7834ce63f236f729
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Orgad Shaneh
2023-11-22 20:28:43 +02:00
committed by Orgad Shaneh
parent 27055e4c39
commit 0da6fe6890

View File

@@ -79,12 +79,12 @@ static int skipChars(QTextCursor *tc,
return count;
}
static int skipCharsForward(QTextCursor *tc, std::function<bool(const QChar &)> skip)
static int skipCharsForward(QTextCursor *tc, const std::function<bool(const QChar &)> &skip)
{
return skipChars(tc, QTextCursor::NextCharacter, 0, skip);
}
static int skipCharsBackward(QTextCursor *tc, std::function<bool(const QChar &)> skip)
static int skipCharsBackward(QTextCursor *tc, const std::function<bool(const QChar &)> &skip)
{
return skipChars(tc, QTextCursor::PreviousCharacter, -1, skip);
}