input: fix warning about nodiscard
std::any_of is used here in a way it was never meant to be used... Instead just write out the loop
This commit is contained in:
parent
4a70793e2b
commit
4dffc09aaa
1 changed files with 5 additions and 2 deletions
|
@ -178,7 +178,6 @@ public:
|
||||||
* The method @p function is invoked on each input filter. Processing is stopped if
|
* The method @p function is invoked on each input filter. Processing is stopped if
|
||||||
* a filter returns @c true for @p function.
|
* a filter returns @c true for @p function.
|
||||||
*
|
*
|
||||||
* The UnaryPredicate is defined like the UnaryPredicate of std::any_of.
|
|
||||||
* The signature of the function should be equivalent to the following:
|
* The signature of the function should be equivalent to the following:
|
||||||
* @code
|
* @code
|
||||||
* bool function(const InputEventFilter *spy);
|
* bool function(const InputEventFilter *spy);
|
||||||
|
@ -190,7 +189,11 @@ public:
|
||||||
template<class UnaryPredicate>
|
template<class UnaryPredicate>
|
||||||
void processFilters(UnaryPredicate function)
|
void processFilters(UnaryPredicate function)
|
||||||
{
|
{
|
||||||
std::any_of(m_filters.constBegin(), m_filters.constEnd(), function);
|
for (const auto filter : std::as_const(m_filters)) {
|
||||||
|
if (function(filter)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue