summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qdirmodel.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-11-30 14:19:39 +0100
committerMarc Mutz <marc.mutz@kdab.com>2015-12-01 12:45:36 +0000
commitbf7ce1ff84a735056b64958349a8a831eafe4684 (patch)
tree2131388ef73f9c9f13433a4e1440503a6edb78f7 /src/widgets/itemviews/qdirmodel.cpp
parentcb7d397e3dbc769f8332a03858b28eddc7519279 (diff)
QDirModel: replace a copy by a reference
Since we are storing pointers to the elements of the vector thus copied, we better make sure we don't cause it to deep-copy. The old code was fragile in that sense, using a reference removes one layer of potential mess-ups. Change-Id: Ib8ebbb47c2a478b5e666e767d05429700b528afd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'src/widgets/itemviews/qdirmodel.cpp')
-rw-r--r--src/widgets/itemviews/qdirmodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/itemviews/qdirmodel.cpp b/src/widgets/itemviews/qdirmodel.cpp
index ddc75ef176..daf00e9362 100644
--- a/src/widgets/itemviews/qdirmodel.cpp
+++ b/src/widgets/itemviews/qdirmodel.cpp
@@ -168,7 +168,7 @@ void QDirModelPrivate::invalidate()
while (!nodes.empty()) {
const QDirNode *current = nodes.pop();
current->stat = false;
- const QVector<QDirNode> children = current->children;
+ const QVector<QDirNode> &children = current->children;
for (int i = 0; i < children.count(); ++i)
nodes.push(&children.at(i));
}