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

@@ -139,7 +139,8 @@ Data::StatisticalChart StatisticalChartFromJSON(const QByteArray &json) {
for (auto &line : result.lines) {
const auto colorIt = colors.constFind(line.idString);
if (colorIt != colors.constEnd() && (*colorIt).isString()) {
const auto match = QRegularExpression(colorPattern).match(
static const auto RegExp = QRegularExpression(u"(.*)(#.*)"_q);
const auto match = RegExp.match(
colorIt->toString());
if (match.hasMatch()) {
line.colorKey = match.captured(1);