Refactoring.

Use a static QRegularExpression object to avoid recreating the regular expressions.
develop
Roman Telezhynskyi 2024-04-17 13:05:42 +03:00
parent f1081a2aad
commit 5199f4d4bc
1 changed files with 3 additions and 2 deletions

View File

@ -1149,8 +1149,9 @@ void VDomDocument::SetLabelTemplate(QDomElement &element, const QVector<VLabelTe
//---------------------------------------------------------------------------------------------------------------------
void VDomDocument::ValidateVersion(const QString &version)
{
const QRegularExpression rx(QStringLiteral("^([0-9]|[1-9][0-9]|[1-2][0-5][0-5]).([0-9]|[1-9][0-9]|[1-2][0-5][0-5])"
".([0-9]|[1-9][0-9]|[1-2][0-5][0-5])$"));
static const QRegularExpression rx(
QStringLiteral("^([0-9]|[1-9][0-9]|[1-2][0-5][0-5]).([0-9]|[1-9][0-9]|[1-2][0-5][0-5])"
".([0-9]|[1-9][0-9]|[1-2][0-5][0-5])$"));
if (!rx.match(version).hasMatch())
{