From 60e5167400d63beb41872759541b9d9a49ea3b3a Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 12 Jun 2014 18:34:44 +0300 Subject: [PATCH] Fix for VDetail::Missing method. Now work correct. --HG-- branch : feature --- src/app/geometry/vdetail.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) 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(); } //---------------------------------------------------------------------------------------------------------------------