use static (And const where applicable) regular expression objects

the speed increase here is noticable since the work of creating a regex object is only done once per session
This commit is contained in:
garak
2022-11-22 22:57:26 -05:00
committed by t
parent d1bdbc2741
commit 37fcfba829
18 changed files with 79 additions and 56 deletions

View File

@@ -31,7 +31,7 @@ PreferenceEditor::~PreferenceEditor()
void PreferenceEditor::populateFields() {
QStringList themes = { "default" };
QRegularExpression re(":/themes/([A-z0-9_-]+).qss");
static const QRegularExpression re(":/themes/([A-z0-9_-]+).qss");
QDirIterator it(":/themes", QDirIterator::Subdirectories);
while (it.hasNext()) {
QString themeName = re.match(it.next()).captured(1);