diff options
author | Anton Kudryavtsev <antkudr@mail.ru> | 2017-03-27 22:44:22 +0300 |
---|---|---|
committer | Anton Kudryavtsev <antkudr@mail.ru> | 2017-03-28 07:18:26 +0000 |
commit | 18d6c82299d51aacca55465dd1a2066a93440618 (patch) | |
tree | 073ddf23294be5f6d189cad61ea0451df5bc95d8 /src/plugins | |
parent | e8cf0bf5f8fe0dd2b4bbfa0c85a32e7edb69e2f4 (diff) |
Prefer rvalue versions of toLower() and toUpper()
... to re-use existing buffers.
Change-Id: Ib2bc938f1cf0451c1dbc012b3db022b878e987cb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/windows/qwindowstheme.cpp | 4 | ||||
-rw-r--r-- | src/plugins/sqldrivers/psql/qsql_psql.cpp | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp index 4ae1a751e9..3e2cb5e9e9 100644 --- a/src/plugins/platforms/windows/qwindowstheme.cpp +++ b/src/plugins/platforms/windows/qwindowstheme.cpp @@ -815,14 +815,14 @@ QString QWindowsFileIconEngine::cacheKey() const // Return "" for .exe, .lnk and .ico extensions. // It is faster to just look at the file extensions; // avoiding slow QFileInfo::isExecutable() (QTBUG-13182) - const QString &suffix = fileInfo().suffix(); + QString suffix = fileInfo().suffix(); if (!suffix.compare(QLatin1String("exe"), Qt::CaseInsensitive) || !suffix.compare(QLatin1String("lnk"), Qt::CaseInsensitive) || !suffix.compare(QLatin1String("ico"), Qt::CaseInsensitive)) { return QString(); } return QLatin1String("qt_.") - + (suffix.isEmpty() ? fileInfo().fileName() : suffix.toUpper()); // handle "Makefile" ;) + + (suffix.isEmpty() ? fileInfo().fileName() : std::move(suffix).toUpper()); // handle "Makefile" ;) } QPixmap QWindowsFileIconEngine::filePixmap(const QSize &size, QIcon::Mode, QIcon::State) diff --git a/src/plugins/sqldrivers/psql/qsql_psql.cpp b/src/plugins/sqldrivers/psql/qsql_psql.cpp index 19de9a8003..a54ceefb6f 100644 --- a/src/plugins/sqldrivers/psql/qsql_psql.cpp +++ b/src/plugins/sqldrivers/psql/qsql_psql.cpp @@ -1073,12 +1073,12 @@ QSqlIndex QPSQLDriver::primaryIndex(const QString& tablename) const if (isIdentifierEscaped(tbl, QSqlDriver::TableName)) tbl = stripDelimiters(tbl, QSqlDriver::TableName); else - tbl = tbl.toLower(); + tbl = std::move(tbl).toLower(); if (isIdentifierEscaped(schema, QSqlDriver::TableName)) schema = stripDelimiters(schema, QSqlDriver::TableName); else - schema = schema.toLower(); + schema = std::move(schema).toLower(); switch(d->pro) { case QPSQLDriver::Version6: @@ -1153,12 +1153,12 @@ QSqlRecord QPSQLDriver::record(const QString& tablename) const if (isIdentifierEscaped(tbl, QSqlDriver::TableName)) tbl = stripDelimiters(tbl, QSqlDriver::TableName); else - tbl = tbl.toLower(); + tbl = std::move(tbl).toLower(); if (isIdentifierEscaped(schema, QSqlDriver::TableName)) schema = stripDelimiters(schema, QSqlDriver::TableName); else - schema = schema.toLower(); + schema = std::move(schema).toLower(); QString stmt; switch(d->pro) { |