diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2014-08-16 13:03:38 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-06-22 10:55:58 +0000 |
commit | 9e6a61447c639c236f0d0306c21cf59db478eafe (patch) | |
tree | c56ea7eba317d8b91166f5fe93f2b7f39a9d5bd8 /src/gui | |
parent | 3e6f36175a60bcd869debba00518d805f6dc8034 (diff) |
QIcon: don't use a QList<QImage>
QImage is larger than a void*, so holding them in a QList is needlessly
inefficient.
Use QVector instead.
Change-Id: Ifcc9eca18a87e29327586506e3a3bb7874c8b3a7
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/image/qicon.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index 40ba84bb14..cca8052424 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -362,7 +362,7 @@ static inline int origIcoDepth(const QImage &image) return s.isEmpty() ? 32 : s.toInt(); } -static inline int findBySize(const QList<QImage> &images, const QSize &size) +static inline int findBySize(const QVector<QImage> &images, const QSize &size) { for (int i = 0; i < images.size(); ++i) { if (images.at(i).size() == size) @@ -426,7 +426,7 @@ void QPixmapIconEngine::addFile(const QString &fileName, const QSize &size, QIco // these files may contain low-resolution images. As this information is lost, // ICOReader sets the original format as an image text key value. Read all matching // images into a list trying to find the highest quality per size. - QList<QImage> icoImages; + QVector<QImage> icoImages; while (imageReader.read(&image)) { if (ignoreSize || image.size() == size) { const int position = findBySize(icoImages, image.size()); |