summaryrefslogtreecommitdiffstats
path: root/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-11-30 12:19:31 +0100
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-12-23 09:14:07 +0000
commit2d4295f16761a0e47b5218bbb1db5c14d16ce4fe (patch)
treeade31a18b55496d4c77fce1b18331917eb8362c0 /src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp
parent4e628397b0ef6f8d5e9294e85507488cebe740f3 (diff)
QGraphicsView: replace some Q_FOREACH loops over const locals with C++11 range-for
This needs to be handled a bit carefully, because Qt containers will detach upon being iterated over using range-for. In the cases of this patch, that cannot happen, because all containers are local and marked as const (either by this patch or before). Separate patches will deal with other situations. Range-for loops are much more efficient than foreach loops. This patch shaves ~1.8KiB of text size off an optimized Linux AMD64 GCC 4.9 build. Change-Id: I5c58658937ac4323594161bf94a2fce3c5667914 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp')
-rw-r--r--src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp b/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp
index adc77ded47..e8501474a5 100644
--- a/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp
+++ b/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp
@@ -2588,7 +2588,7 @@ void QGraphicsAnchorLayoutPrivate::identifyFloatItems(const QSet<AnchorData *> &
{
QSet<QGraphicsLayoutItem *> nonFloating;
- foreach (const AnchorData *ad, visited)
+ for (const AnchorData *ad : visited)
identifyNonFloatItems_helper(ad, &nonFloating);
QSet<QGraphicsLayoutItem *> allItems;