forked from qt-creator/qt-creator
Modelinglib: Avoid temporary extensive copy
Change-Id: I25fb6f671cc392836b829889987c516aa722bc92 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user