Optimization. Make const in InsertTag method

--HG--
branch : feature
This commit is contained in:
Valentina Zhuravska 2016-04-02 10:25:21 +03:00
parent ebab22d6ca
commit 56db3f6f1a
2 changed files with 3 additions and 4 deletions

View File

@ -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();
}

View File

@ -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)