Changeset View
Changeset View
Standalone View
Standalone View
src/file/regexpcache.cpp
Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Line(s) | 60 | for (const QString& filter : filters) { | |||
---|---|---|---|---|---|
73 | f.replace(QLatin1Char('?'), QLatin1Char('.')); | 73 | f.replace(QLatin1Char('?'), QLatin1Char('.')); | ||
74 | f.replace(QStringLiteral("*"), QStringLiteral(".*")); | 74 | f.replace(QStringLiteral("*"), QStringLiteral(".*")); | ||
75 | f = QLatin1String("^") + f + QLatin1String("$"); | 75 | f = QLatin1String("^") + f + QLatin1String("$"); | ||
76 | 76 | | |||
77 | m_regexpCache.append(QRegularExpression(f)); | 77 | m_regexpCache.append(QRegularExpression(f)); | ||
78 | } | 78 | } | ||
79 | 79 | | |||
80 | // Combine all suffixes into one large RE: "^.*(foo|bar|baz)$" | 80 | // Combine all suffixes into one large RE: "^.*(foo|bar|baz)$" | ||
81 | auto suffixMatch = QLatin1String("^.*\\.("); | 81 | QString suffixMatch = QLatin1String("^.*\\.("); | ||
alexeymin: can probably just be `QString suffixMatch(QLatin1String("^.*\\.("));` then, without `=` | |||||
Sure, but it hardly matters, copy-elision will make the statements equivalent. carewolf: Sure, but it hardly matters, copy-elision will make the statements equivalent. | |||||
82 | suffixMatch += suffixes.join(QChar('|')); | 82 | suffixMatch += suffixes.join(QChar('|')); | ||
83 | suffixMatch += QLatin1String(")$"); | 83 | suffixMatch += QLatin1String(")$"); | ||
84 | qCDebug(BALOO) << suffixMatch; | 84 | qCDebug(BALOO) << suffixMatch; | ||
85 | m_regexpCache.prepend(QRegularExpression(suffixMatch)); | 85 | m_regexpCache.prepend(QRegularExpression(suffixMatch)); | ||
86 | } | 86 | } |
can probably just be QString suffixMatch(QLatin1String("^.*\\.(")); then, without =