From 204a6cca8a40c601c9672f5c80e7279a246d5084 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Thu, 13 Nov 2025 17:09:34 -0500 Subject: [PATCH] refactor: Settings make the name checking regex static in the method --- src/lib/common/Settings.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/common/Settings.cpp b/src/lib/common/Settings.cpp index 7589d96cb..626203ac7 100644 --- a/src/lib/common/Settings.cpp +++ b/src/lib/common/Settings.cpp @@ -155,7 +155,8 @@ QVariant Settings::defaultValue(const QString &key) // The localhost name can contain spaces and non word characters QString name = QSysInfo::machineHostName().simplified(); name.replace(QLatin1String(" "), QStringLiteral("_")); - name.replace(QRegularExpression(QLatin1String("\\W")), QLatin1String("")); + static const auto nameRegex = QRegularExpression(QLatin1String("\\W")); + name.replace(nameRegex, QLatin1String("")); return name; }