summaryrefslogtreecommitdiffstats
path: root/src/render/backend/stringtoint_p.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-05-09 13:31:40 +0200
committerSean Harmer <sean.harmer@kdab.com>2016-05-14 16:02:08 +0000
commitc781a2b4aa07b2f245d04e62eb066cc468285dd6 (patch)
tree8b3e5a021607361d32003ce143cdcd74665f57ed /src/render/backend/stringtoint_p.h
parent8ac9e30bb13ee09de71fe07ca85d89d8f6605da9 (diff)
StringToInt: add an overload taking QLatin1String
About 50% of callers pass static string literals, which can be converted from QStringLiteral to QLatin1String if by adding the overload. Because of the complicated logic in the existing overload, no attempt is made in this commit to hand down the QLatin1String until the actual comparison. Instead, the QString overload is called, for now. Saves almost 1KiB in text size in Render on optimized GCC 6.0 Linux AMD64 builds. Change-Id: I37ed154ec49349f251b6a4515c20eb7cb5c89181 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/backend/stringtoint_p.h')
-rw-r--r--src/render/backend/stringtoint_p.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/render/backend/stringtoint_p.h b/src/render/backend/stringtoint_p.h
index 27a3f6f05..2d9e566fb 100644
--- a/src/render/backend/stringtoint_p.h
+++ b/src/render/backend/stringtoint_p.h
@@ -65,6 +65,7 @@ class Q_AUTOTEST_EXPORT StringToInt
{
public:
static int lookupId(const QString &str);
+ static int lookupId(QLatin1String str);
static QString lookupString(int idx);
private: