summaryrefslogtreecommitdiff
path: root/doc/src/snippets/code/src_gui_kernel_qapplication.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/code/src_gui_kernel_qapplication.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/code/src_gui_kernel_qapplication.cpp')
-rw-r--r--doc/src/snippets/code/src_gui_kernel_qapplication.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/src/snippets/code/src_gui_kernel_qapplication.cpp b/doc/src/snippets/code/src_gui_kernel_qapplication.cpp
index c93a25cf28..766b2491d9 100644
--- a/doc/src/snippets/code/src_gui_kernel_qapplication.cpp
+++ b/doc/src/snippets/code/src_gui_kernel_qapplication.cpp
@@ -158,13 +158,13 @@ appname -session id
//! [10]
-foreach (QString command, mySession.restartCommand())
+foreach (const QString &command, mySession.restartCommand())
do_something(command);
//! [10]
//! [11]
-foreach (QString command, mySession.discardCommand())
+foreach (const QString &command, mySession.discardCommand())
do_something(command);
//! [11]