Refactoring.
Use a static QRegularExpression object to avoid recreating the regular expressions.
This commit is contained in:
parent
f1081a2aad
commit
5199f4d4bc
|
@ -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())
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user