From 56db3f6f1aa9a4539d4255fbe59c3673f9c5b035 Mon Sep 17 00:00:00 2001 From: Valentina Zhuravska Date: Sat, 2 Apr 2016 10:25:21 +0300 Subject: [PATCH] Optimization. Make const in InsertTag method --HG-- branch : feature --- src/libs/ifc/xml/vabstractpattern.cpp | 5 ++--- src/libs/ifc/xml/vabstractpattern.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index 2b4eff537..452986f9e 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -1098,18 +1098,17 @@ void VAbstractPattern::CheckTagExists(const QString &tag) } //--------------------------------------------------------------------------------------------------------------------- -void VAbstractPattern::InsertTag(QStringList tags, QDomElement element) +void VAbstractPattern::InsertTag(const QStringList tags, const QDomElement element) { QDomElement pattern = documentElement(); for (int i = tags.indexOf(element.tagName())-1; i >= 0; --i) { - QDomNodeList list = elementsByTagName(tags.at(i)); + const QDomNodeList list = elementsByTagName(tags.at(i)); if (list.isEmpty()) { continue; } pattern.insertAfter(element, list.at(0)); - return; } SetVersion(); } diff --git a/src/libs/ifc/xml/vabstractpattern.h b/src/libs/ifc/xml/vabstractpattern.h index 675f1160f..98d254d57 100644 --- a/src/libs/ifc/xml/vabstractpattern.h +++ b/src/libs/ifc/xml/vabstractpattern.h @@ -265,7 +265,7 @@ protected: void SetActivPP(const QString& name); void CheckTagExists(const QString &tag); - void InsertTag(QStringList tags, QDomElement element); + void InsertTag(const QStringList tags, const QDomElement element); private: Q_DISABLE_COPY(VAbstractPattern)