summaryrefslogtreecommitdiffstats
path: root/src/corelib/statemachine
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-10-12 13:38:32 +0200
committerMarc Mutz <marc.mutz@kdab.com>2015-10-15 00:45:11 +0000
commit6951f0e4afb03870f069465f8016e76e4ef1ba41 (patch)
tree8ba4b7e8afcd69ca5f3e10a205d793f45f0f017b /src/corelib/statemachine
parent2d2cb6434f1d6e00f421c98b20467ff3f4388319 (diff)
QCompleter::splitPath(): don't get tangled up in strings
- Don't store "\\" as a QString just for passing it to QString:.startsWith() and prepend(). Keep it a QLatin1String. -> one allocation less - Don't use said QString as a flag, use a bool - Don't store QDir::separator() in a QString -> one allocation less -> two indexing operations less - Don't retrieve QDir::separator() from said QString as QString(sep[0]) -> one more allocation less - Don't look for a QChar in a string by using QRegExp; use the QChar overload instead -> one more allocation (at _least_) less - Don't convert QDir::separator() with QDir::fromNativeSeparators(); it will _always_ be '/'... -> one expensive function call less -> two QString allocations less -> one QString(QChar) introduced -> one allocation more -> could be removed with QStringLiteral/QString::fromLatin1Char() Change-Id: I802e66685a95b08cfc557defc63e5f16a7e6306b Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/statemachine')
0 files changed, 0 insertions, 0 deletions