refactor: ComputerNameValidator define regex static where used

This commit is contained in:
sithlord48
2026-02-23 22:32:32 -05:00
committed by Nick Bolton
parent 568f5c7fc5
commit 4e641adae9
2 changed files with 3 additions and 7 deletions

View File

@ -17,7 +17,9 @@ ComputerNameValidator::ComputerNameValidator(const QString &message) : IStringVa
bool ComputerNameValidator::validate(const QString &input) const
{
auto match = m_nameValidator.match(input);
static const auto s_nameValidator =
QRegularExpression(QStringLiteral("^[\\w\\._-]{0,255}$"), QRegularExpression::CaseInsensitiveOption);
auto match = s_nameValidator.match(input);
return match.hasMatch();
}