summaryrefslogtreecommitdiff
path: root/doc/src/snippets/droparea.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-07-26 14:03:00 +0200
committerOlivier Goffart <olivier.goffart@nokia.com>2010-07-26 16:04:18 +0200
commita882a46b1c60e5774ade68eaac60922b19a08835 (patch)
treed603f2ad38e235392e3bccdee51836c2667cfda7 /doc/src/snippets/droparea.cpp
parent3a08c5b1682e211bf664c21850187e2b15e89c23 (diff)
downloadqt4-tools-a882a46b1c60e5774ade68eaac60922b19a08835.tar.gz
Doc: use const& in foreach when applicable.
Const reference are slightly faster than doing a copy of the object on each iteration. Lead by example by having this pattern right in our documentation
Diffstat (limited to 'doc/src/snippets/droparea.cpp')
-rw-r--r--doc/src/snippets/droparea.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/src/snippets/droparea.cpp b/doc/src/snippets/droparea.cpp
index bbcf82da02..bb49dd7e63 100644
--- a/doc/src/snippets/droparea.cpp
+++ b/doc/src/snippets/droparea.cpp
@@ -130,7 +130,7 @@ QPixmap DropArea::extractPixmap(const QByteArray &data, const QString &format)
QList<QByteArray> imageFormats = QImageReader::supportedImageFormats();
QPixmap pixmap;
- foreach (QByteArray imageFormat, imageFormats) {
+ foreach (const QByteArray &imageFormat, imageFormats) {
if (format.mid(6) == QString(imageFormat)) {
pixmap.loadFromData(data, imageFormat);
break;