2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Instantiate QRegularExpression instances statically

This commit is contained in:
Ilya Fedin
2023-12-22 03:50:04 +04:00
committed by John Preston
parent 4b297bfa09
commit e6b9a07163
18 changed files with 74 additions and 47 deletions

View File

@@ -169,7 +169,8 @@ void PhoneWidget::submit() {
// Check if such account is authorized already.
const auto digitsOnly = [](QString value) {
return value.replace(QRegularExpression("[^0-9]"), QString());
static const auto RegExp = QRegularExpression("[^0-9]");
return value.replace(RegExp, QString());
};
const auto phoneDigits = digitsOnly(phone);
for (const auto &[index, existing] : Core::App().domain().accounts()) {