diff options
author | hjk <hjk121@nokiamail.com> | 2013-04-22 08:34:53 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-23 18:57:45 +0200 |
commit | 32629676b977d98e853fc6101a63c0d888ff5598 (patch) | |
tree | 9c456ae30ee87beeecaa2f77f7b628bce6458c67 /src/corelib/io/qfileinfo.cpp | |
parent | 38bf6da7ddaa6975ea00c27144fcbc70c789d398 (diff) |
Use a QVector<QDateTime> instead of an array in QFileInfoPrivate
Since QDateTime is pimpled, default allocation is expensive and
regularly shows up in profiles of code using QFileInfo.
For Qt 6, QDateTime's data members should be put into the class
proper, and this change here reverted.
Change-Id: I94a50e467b12772e1076181eb2ac6031984d8802
Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/corelib/io/qfileinfo.cpp')
-rw-r--r-- | src/corelib/io/qfileinfo.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index 7fcb4154f2..addcd772ab 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -187,6 +187,8 @@ uint QFileInfoPrivate::getFileFlags(QAbstractFileEngine::FileFlags request) cons QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request) const { Q_ASSERT(fileEngine); // should never be called when using the native FS + if (fileTimes.size() != 3) + fileTimes.resize(3); if (!cache_enabled) clearFlags(); uint cf; |