summaryrefslogtreecommitdiffstats
path: root/src/printsupport
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2014-10-08 10:26:27 +0200
committerMarc Mutz <marc.mutz@kdab.com>2014-10-09 09:41:51 +0200
commitbf1df558461f21827eaad9d5d9541def784980a2 (patch)
tree1c58599a96968000808362b47f069302fa0582ee /src/printsupport
parent05663e29d047851adb9a1ef440fb78b38ff3cc9b (diff)
Don't use QByteArrayLiteral in comparisons
For const char*s, operator== is overloaded, so comparing to a (C) string literal is efficient, since qstrcmp doesn't require the length of the strings to compare. OTOH, QByteArrayLiteral, when not using RVO, litters the code with QByteArray dtor calls, which are not inline. Worse, absent lambdas, it even allocates memory. So, just compare with a (C) string literal instead. Change-Id: Id3bfdc89558ba51911f6317a7a73c287f96e6f24 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/printsupport')
-rw-r--r--src/printsupport/kernel/qprint_p.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/printsupport/kernel/qprint_p.h b/src/printsupport/kernel/qprint_p.h
index c674290d16..504a0d6e20 100644
--- a/src/printsupport/kernel/qprint_p.h
+++ b/src/printsupport/kernel/qprint_p.h
@@ -277,9 +277,9 @@ public:
static QPrint::DuplexMode ppdChoiceToDuplexMode(const QByteArray &choice)
{
- if (choice == QByteArrayLiteral("DuplexTumble"))
+ if (choice == "DuplexTumble")
return QPrint::DuplexShortSide;
- else if (choice == QByteArrayLiteral("DuplexNoTumble"))
+ else if (choice == "DuplexNoTumble")
return QPrint::DuplexLongSide;
else // None or SimplexTumble or SimplexNoTumble
return QPrint::DuplexNone;