Do not anchor an already-anchored regexp
wildcardToRegularExpression() returns an anchored regexp, so it is pointless to anchor it again. Change-Id: If470179d63ae7ca2e7f137c0f403ec5bb5be8aaf Task-number: QTBUG-81396 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
This commit is contained in:
parent
6faaef5a66
commit
800dda19a6
@ -181,7 +181,7 @@ QDirIteratorPrivate::QDirIteratorPrivate(const QFileSystemEntry &entry, const QS
|
||||
#elif QT_CONFIG(regularexpression)
|
||||
nameRegExps.reserve(nameFilters.size());
|
||||
for (const auto &filter : nameFilters) {
|
||||
QString re = QRegularExpression::anchoredPattern(QRegularExpression::wildcardToRegularExpression(filter));
|
||||
QString re = QRegularExpression::wildcardToRegularExpression(filter);
|
||||
nameRegExps.append(
|
||||
QRegularExpression(re, (filters & QDir::CaseSensitive) ? QRegularExpression::NoPatternOption : QRegularExpression::CaseInsensitiveOption));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user