From 1ebd0d5e4ad2dd27909b58a57ef15b1cc62d5d02 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 15 Apr 2009 12:03:38 +0200 Subject: Tiny optimization to QImage::setColorTable() Task: 250730 --- src/gui/image/qimage.cpp | 8 ++++++-- 1 file 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 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; + } + } } /*! -- cgit v0.12