summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/picture
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-07-26 12:03:00 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-07-26 14:04:18 (GMT)
commita882a46b1c60e5774ade68eaac60922b19a08835 (patch)
treed603f2ad38e235392e3bccdee51836c2667cfda7 /doc/src/snippets/picture
parent3a08c5b1682e211bf664c21850187e2b15e89c23 (diff)
downloadQt-a882a46b1c60e5774ade68eaac60922b19a08835.zip
Qt-a882a46b1c60e5774ade68eaac60922b19a08835.tar.gz
Qt-a882a46b1c60e5774ade68eaac60922b19a08835.tar.bz2
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/picture')
-rw-r--r--doc/src/snippets/picture/picture.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/src/snippets/picture/picture.cpp b/doc/src/snippets/picture/picture.cpp
index 0c5712a..5283978 100644
--- a/doc/src/snippets/picture/picture.cpp
+++ b/doc/src/snippets/picture/picture.cpp
@@ -76,7 +76,7 @@ int main()
// FORMATS
//! [2]
QStringList list = QPicture::inputFormatList();
- foreach (QString string, list)
+ foreach (const QString &string, list)
myProcessing(string);
//! [2]
}
@@ -85,7 +85,7 @@ int main()
// OUTPUT
//! [3]
QStringList list = QPicture::outputFormatList();
- foreach (QString string, list)
+ foreach (const QString &string, list)
myProcessing(string);
//! [3]
}