mirror of
https://github.com/huderlem/porymap.git
synced 2026-09-17 05:15:45 -05:00
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:
@@ -609,7 +609,7 @@ void MainWindow::setMetatileLabel(int metatileId, QString label) {
|
||||
if (!metatile)
|
||||
return;
|
||||
|
||||
QRegularExpression expression("[_A-Za-z0-9]*$");
|
||||
static const QRegularExpression expression("[_A-Za-z0-9]*$");
|
||||
QRegularExpressionValidator validator(expression);
|
||||
int pos = 0;
|
||||
if (validator.validate(label, pos) != QValidator::Acceptable) {
|
||||
|
||||
Reference in New Issue
Block a user