Modelinglib: Avoid temporary extensive copy

Change-Id: I25fb6f671cc392836b829889987c516aa722bc92
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Jochen Becher
2018-01-13 19:35:05 +01:00
parent e7d44054e1
commit eb9172d1a0
8 changed files with 25 additions and 25 deletions

View File

@@ -159,7 +159,7 @@ void MCloneDeepVisitor::visitMObject(const MObject *object)
visitMElement(object);
auto cloned = dynamic_cast<MObject *>(m_cloned);
QMT_ASSERT(cloned, return);
foreach (const Handle<MObject> &handle, object->children()) {
for (const Handle<MObject> &handle : object->children()) {
if (handle.hasTarget()) {
MCloneDeepVisitor visitor;
handle.target()->accept(&visitor);
@@ -170,7 +170,7 @@ void MCloneDeepVisitor::visitMObject(const MObject *object)
cloned->addChild(handle.uid());
}
}
foreach (const Handle<MRelation> &handle, object->relations()) {
for (const Handle<MRelation> &handle : object->relations()) {
if (handle.hasTarget()) {
MCloneDeepVisitor visitor;
handle.target()->accept(&visitor);