diff options
author | Gunnar Sletta <gunnar@trolltech.com> | 2009-04-15 10:03:38 (GMT) |
---|---|---|
committer | Gunnar Sletta <gunnar@trolltech.com> | 2009-04-15 10:05:44 (GMT) |
commit | 1ebd0d5e4ad2dd27909b58a57ef15b1cc62d5d02 (patch) | |
tree | 16ac9cd471205ca2160e09fa0e84d31e4ff5935e /src/gui/image | |
parent | 79891d8284736dc318cff8d9c3f6d7a6e87affd9 (diff) | |
download | Qt-1ebd0d5e4ad2dd27909b58a57ef15b1cc62d5d02.zip Qt-1ebd0d5e4ad2dd27909b58a57ef15b1cc62d5d02.tar.gz Qt-1ebd0d5e4ad2dd27909b58a57ef15b1cc62d5d02.tar.bz2 |
Tiny optimization to QImage::setColorTable()
Task: 250730
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qimage.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index c7a20db..14e8b8f 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -1691,8 +1691,12 @@ void QImage::setColorTable(const QVector<QRgb> colors) d->colortable = colors; d->has_alpha_clut = false; - for (int i = 0; i < d->colortable.size(); ++i) - d->has_alpha_clut |= (qAlpha(d->colortable.at(i)) != 255); + for (int i = 0; i < d->colortable.size(); ++i) { + if (qAlpha(d->colortable.at(i)) != 255) { + d->has_alpha_clut = true; + break; + } + } } /*! |