diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-02-28 15:18:11 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-02-25 02:21:07 +0000 |
commit | 8dc024adc64ba667ede2854b2411775a9e18cafc (patch) | |
tree | 5333e3883c038d9bfc8305fefbac81f6eed8003d /src/corelib/io/qfile.cpp | |
parent | 8b5651eb41954cbcbcb3ddd66179711dac0bc1df (diff) |
QtCore: replace QStringLiteral with QLatin1String when appending
It makes little sense to use QStringLiteral for strings which are
immediately appended to, or which are appended to other strings,
because no dynamic memory allocation is saved by doing so. But if
the only advantage of QStringLiteral does not apply, all its
disadvantages dominate, to wit: injection of calls to qstring dtor,
non-sharability of data between C strings and QStringLiterals and
among QStringLiterals, and doubled storage requirements.
Fix by replacing QStringLiteral with QLatin1String.
Saves 1156B in text size on stripped optimized Linux AMD64 GCC 4.9
builds.
Change-Id: If805e431f570ec1d2ac62c548f516f1b17390c3a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/io/qfile.cpp')
-rw-r--r-- | src/corelib/io/qfile.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index ccacb6ed20..9b1bd3a411 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -581,7 +581,7 @@ QFile::rename(const QString &newName) #ifdef Q_OS_LINUX // rename() on Linux simply does nothing when renaming "foo" to "Foo" on a case-insensitive // FS, such as FAT32. Move the file away and rename in 2 steps to work around. - QTemporaryFile tempFile(d->fileName + QStringLiteral(".XXXXXX")); + QTemporaryFile tempFile(d->fileName + QLatin1String(".XXXXXX")); tempFile.setAutoRemove(false); if (!tempFile.open(QIODevice::ReadWrite)) { d->setError(QFile::RenameError, tempFile.errorString()); |