diff --git a/src/app/geometry/vdetail.cpp b/src/app/geometry/vdetail.cpp index 6e0f6855a..ff0c703ca 100644 --- a/src/app/geometry/vdetail.cpp +++ b/src/app/geometry/vdetail.cpp @@ -255,25 +255,26 @@ VDetail VDetail::RemoveEdge(const quint32 &index) const //--------------------------------------------------------------------------------------------------------------------- QList VDetail::Missing(const VDetail &det) const { - QList list; if (nodes.size() == det.CountNode()) { - return list; + return QList(); } - qint32 j = 0; + QSet set1; for (qint32 i = 0; i < nodes.size(); ++i) { - if (nodes.at(i).getId() == det.at(j).getId()) - { - ++j; - } - else - { - list.append(nodes.at(i).getId()); - } + set1.insert(nodes.at(i).getId()); } - return list; + + QSet set2; + for (qint32 j = 0; j < det.CountNode(); ++j) + { + set2.insert(det.at(j).getId()); + } + + QSet set3 = set1.subtract(set2); + + return set3.toList(); } //---------------------------------------------------------------------------------------------------------------------