QCommandLineOption: prevent aggressive inlining
Even though we expect very few option names, GCC unrolls the loop calling IsInvalidName::operator() four times. Together with the lead-in/lead-out for size() % 4 != 0, that makes for five inlined copies of the function call operator. I don't know how to prevent the unrolling, but at least I can stop the inlining. Change-Id: Ib9d6c33e8193464a73927a92b8b54c3452cb26a3 Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
parent
c3597c3fcf
commit
a3f780b4a1
@ -250,6 +250,7 @@ namespace {
|
|||||||
typedef bool result_type;
|
typedef bool result_type;
|
||||||
typedef QString argument_type;
|
typedef QString argument_type;
|
||||||
|
|
||||||
|
Q_NEVER_INLINE
|
||||||
result_type operator()(const QString &name) const Q_DECL_NOEXCEPT
|
result_type operator()(const QString &name) const Q_DECL_NOEXCEPT
|
||||||
{
|
{
|
||||||
if (Q_UNLIKELY(name.isEmpty()))
|
if (Q_UNLIKELY(name.isEmpty()))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user